diff --git a/.golangci.yaml b/.golangci.yaml index accbf49a8..8fca4107b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,7 +1,5 @@ run: timeout: 5m - skip-dirs: - - vendor linters-settings: goimports: @@ -15,6 +13,7 @@ linters: ## enabled by default - errcheck - gosimple + - gofmt - govet - ineffassign - staticcheck diff --git a/Dockerfile b/Dockerfile index 8d27a03d2..87dd6ad28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM --platform=${BUILDPLATFORM:-linux/amd64} registry.access.redhat.com/ubi8/go-toolset:1.20.12-2 AS builder +FROM --platform=${BUILDPLATFORM:-linux/amd64} registry.access.redhat.com/ubi8/go-toolset:1.20.12-2.1711036149 AS builder ARG TARGETOS ARG TARGETARCH diff --git a/Makefile b/Makefile index cb2fdccd9..a366160aa 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,7 @@ verify-manifests: ## Verify manifests are up to date. # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29.x .PHONY: test -test: manifests generate fmt vet envtest ## Run tests. +test: envtest ## Run tests. KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out .PHONY: test-qemu @@ -401,6 +401,7 @@ ENVTEST_NOT_LOCAL ?= $(shell go env GOPATH)/bin/$(shell go env GOOS)_$(shell go ## Tool Versions KUSTOMIZE_VERSION ?= v5.3.0 CONTROLLER_TOOLS_VERSION ?= v0.14.0 +SETUP_ENVTEST_VERSION ?= v0.0.0-20240318095156-c7e1dc9b5302 YQ_VERSION ?= v4.2.0 # Set the Operator SDK version to use. By default, what is installed on the system is used. @@ -441,11 +442,11 @@ $(CONTROLLER_GEN): $(LOCALBIN) .PHONY: envtest envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) - test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(SETUP_ENVTEST_VERSION) .PHONY: envtest-not-local envtest-not-local: ## Download envtest-setup for qemu unit tests - specific to github action. - test -s setup-envtest || go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s setup-envtest || go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(SETUP_ENVTEST_VERSION) .PHONY: operator-sdk OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk