Kubernetes Operator that creates Service Endpoints from Secrets
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

update lint

+38 -34
+30 -26
.golangci.yml
··· 1 + version: "2" 1 2 run: 2 - timeout: 5m 3 3 allow-parallel-runners: true 4 - 5 - issues: 6 - # don't skip warning about doc comments 7 - # don't exclude the default set of lint 8 - exclude-use-default: false 9 - # restore some of the defaults 10 - # (fill in the rest as needed) 11 - exclude-rules: 12 - - path: "api/*" 13 - linters: 14 - - lll 15 - - path: "internal/*" 16 - linters: 17 - - dupl 18 - - lll 19 4 linters: 20 - disable-all: true 5 + default: none 21 6 enable: 7 + - copyloopvar 22 8 - dupl 23 9 - errcheck 24 - - exportloopref 25 10 - ginkgolinter 26 11 - goconst 27 12 - gocyclo 28 - - gofmt 29 - - goimports 30 - - gosimple 31 13 - govet 32 14 - ineffassign 33 15 - lll ··· 36 18 - prealloc 37 19 - revive 38 20 - staticcheck 39 - - typecheck 40 21 - unconvert 41 22 - unparam 42 23 - unused 43 - 44 - linters-settings: 45 - revive: 24 + settings: 25 + revive: 26 + rules: 27 + - name: comment-spacings 28 + exclusions: 29 + generated: lax 46 30 rules: 47 - - name: comment-spacings 31 + - linters: 32 + - lll 33 + path: api/* 34 + - linters: 35 + - dupl 36 + - lll 37 + path: internal/* 38 + paths: 39 + - third_party$ 40 + - builtin$ 41 + - examples$ 42 + formatters: 43 + enable: 44 + - gofmt 45 + - goimports 46 + exclusions: 47 + generated: lax 48 + paths: 49 + - third_party$ 50 + - builtin$ 51 + - examples$
+1 -1
.tangled/workflows/lint.yaml
··· 14 14 CGO_ENABLED: "0" 15 15 command: | 16 16 go mod download 17 - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.0 17 + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2 18 18 19 19 - name: Run Linter 20 20 environment:
+2 -2
Makefile
··· 212 212 KUSTOMIZE_VERSION ?= v5.4.3 213 213 CONTROLLER_TOOLS_VERSION ?= v0.18.0 214 214 ENVTEST_VERSION ?= release-0.23 215 - GOLANGCI_LINT_VERSION ?= v1.64.0 215 + GOLANGCI_LINT_VERSION ?= v2.7.2 216 216 217 217 .PHONY: kustomize 218 218 kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. ··· 232 232 .PHONY: golangci-lint 233 233 golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary. 234 234 $(GOLANGCI_LINT): $(LOCALBIN) 235 - $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION)) 235 + $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION)) 236 236 237 237 # go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist 238 238 # $1 - target path with name of binary
+3 -3
internal/controller/secretservice_controller.go
··· 174 174 key := client.ObjectKeyFromObject(obj) 175 175 176 176 // 1. Attempt to get the object. This checks if it already exists. 177 - if err := r.Client.Get(ctx, key, obj); err != nil { 177 + if err := r.Get(ctx, key, obj); err != nil { 178 178 // 2. If the object is not found, create it. 179 179 if !errors.IsNotFound(err) { 180 180 return err // Return any error other than NotFound ··· 186 186 } 187 187 188 188 logger.Info("Creating resource", "object", key) 189 - return r.Client.Create(ctx, obj) 189 + return r.Create(ctx, obj) 190 190 } 191 191 192 192 // 3. If the object exists, update it. 193 193 existing := obj.DeepCopyObject().(client.Object) // Deep copy to avoid modifying the cache 194 194 195 195 // Use Patch to apply only the changes, improving efficiency 196 - if err := r.Client.Patch(ctx, obj, client.MergeFrom(existing)); err != nil { 196 + if err := r.Patch(ctx, obj, client.MergeFrom(existing)); err != nil { 197 197 return err 198 198 } 199 199
+2 -2
test/utils/utils.go
··· 22 22 "os/exec" 23 23 "strings" 24 24 25 - . "github.com/onsi/ginkgo/v2" //nolint:golint,revive 25 + . "github.com/onsi/ginkgo/v2" //nolint:revive,staticcheck 26 26 ) 27 27 28 28 const ( ··· 135 135 if err != nil { 136 136 return wd, err 137 137 } 138 - wd = strings.Replace(wd, "/test/e2e", "", -1) 138 + wd = strings.ReplaceAll(wd, "/test/e2e", "") 139 139 return wd, nil 140 140 }