diff --git a/Makefile b/Makefile index 9a38f499..a3345fbc 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ BUILD_DATE ?= $(shell git log -1 --format="%at" | xargs -I{} sh -c 'if [ "$ IMG_BASE ?= $(REPOSITORY) IMG ?= $(IMG_BASE):$(VERSION) CAPSULE_IMG ?= $(REGISTRY)/$(IMG_BASE) +SRC_ROOT = $(shell git rev-parse --show-toplevel) # Options for 'bundle-build' ifneq ($(origin CHANNELS), undefined) @@ -33,6 +34,11 @@ endif all: manager +.PHONY: lint +lint: GOLANGCI_VERSION := v1.51.2 +lint: docker + docker run -t --rm -v $(SRC_ROOT):/app -w /app golangci/golangci-lint:$(GOLANGCI_VERSION) golangci-lint run -v --timeout 5m --config /app/.golangci.yml + # Run tests .PHONY: test test: test-clean generate manifests test-clean @@ -84,9 +90,6 @@ generate: controller-gen apidoc: apidocs-gen $(APIDOCS_GEN) crdoc --resources config/crd/bases --output docs/content/general/crds-apis.md --template docs/template/reference-cr.tmpl -# Helm -SRC_ROOT = $(shell git rev-parse --show-toplevel) - helm-controller-version: $(eval VERSION := $(shell grep 'appVersion:' charts/capsule/Chart.yaml | awk '{print "v"$$2}')) $(eval KO_TAGS := $(shell grep 'appVersion:' charts/capsule/Chart.yaml | awk '{print "v"$$2}')) diff --git a/controllers/tenant/metadata.go b/controllers/tenant/metadata.go index e50e39fb..8a69aef1 100644 --- a/controllers/tenant/metadata.go +++ b/controllers/tenant/metadata.go @@ -13,7 +13,7 @@ const ( TenantNameLabel = "kubernetes.io/metadata.name" ) -// Sets a label on the Tenant object with it's name +// Sets a label on the Tenant object with it's name. func (r *Manager) ensureMetadata(ctx context.Context, tnt *capsulev1beta2.Tenant) (err error) { tnt.SetLabels(map[string]string{ TenantNameLabel: tnt.Name,