···1414 CGO_ENABLED: "0"
1515 command: |
1616 go mod download
1717- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.0
1717+ go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2
18181919 - name: Run Linter
2020 environment:
+2-2
Makefile
···212212KUSTOMIZE_VERSION ?= v5.4.3
213213CONTROLLER_TOOLS_VERSION ?= v0.18.0
214214ENVTEST_VERSION ?= release-0.23
215215-GOLANGCI_LINT_VERSION ?= v1.64.0
215215+GOLANGCI_LINT_VERSION ?= v2.7.2
216216217217.PHONY: kustomize
218218kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
···232232.PHONY: golangci-lint
233233golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
234234$(GOLANGCI_LINT): $(LOCALBIN)
235235- $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
235235+ $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
236236237237# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
238238# $1 - target path with name of binary
+3-3
internal/controller/secretservice_controller.go
···174174 key := client.ObjectKeyFromObject(obj)
175175176176 // 1. Attempt to get the object. This checks if it already exists.
177177- if err := r.Client.Get(ctx, key, obj); err != nil {
177177+ if err := r.Get(ctx, key, obj); err != nil {
178178 // 2. If the object is not found, create it.
179179 if !errors.IsNotFound(err) {
180180 return err // Return any error other than NotFound
···186186 }
187187188188 logger.Info("Creating resource", "object", key)
189189- return r.Client.Create(ctx, obj)
189189+ return r.Create(ctx, obj)
190190 }
191191192192 // 3. If the object exists, update it.
193193 existing := obj.DeepCopyObject().(client.Object) // Deep copy to avoid modifying the cache
194194195195 // Use Patch to apply only the changes, improving efficiency
196196- if err := r.Client.Patch(ctx, obj, client.MergeFrom(existing)); err != nil {
196196+ if err := r.Patch(ctx, obj, client.MergeFrom(existing)); err != nil {
197197 return err
198198 }
199199