Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.11.4
version: v2.12.1
working-directory: ${{ matrix.folder }}
- name: Run linter via makefile target
working-directory: ${{ matrix.folder }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Run golangci-lint with PR comments
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.11.4
version: v2.12.1

verify-license:
name: License verification
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ linters:
ginkgolinter:
forbid-focus-container: true
forbid-spec-pollution: true
goconst:
ignore-tests: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we should add it here as well.
What are the failures ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it done.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so many errors:

......
pkg/plugins/golang/v4/api_test.go:120:14: string `Frigate` has 3 occurrences, make it a constant (goconst)
				Kind:    "Frigate",
				         ^
pkg/plugins/golang/v4/webhook_test.go:44:14: string `crew` has 7 occurrences, make it a constant (goconst)
				Group:   "crew",
				         ^
pkg/plugins/golang/v4/webhook_test.go:45:14: string `test.io` has 8 occurrences, make it a constant (goconst)
				Domain:  "test.io",
				         ^
pkg/plugins/golang/v4/webhook_test.go:47:14: string `Captain` has 4 occurrences, make it a constant (goconst)
				Kind:    "Captain",
				         ^
pkg/plugins/golang/v4/webhook_test.go:49:14: string `captains` has 3 occurrences, make it a constant (goconst)
			Plural:   "captains",
			          ^
pkg/plugins/golang/v4/webhook_test.go:122:15: string `ship` has 3 occurrences, make it a constant (goconst)
					Group:   "ship",
					         ^
pkg/plugins/golang/v4/webhook_test.go:125:15: string `Frigate` has 3 occurrences, make it a constant (goconst)
					Kind:    "Frigate",
					         ^
pkg/plugins/optional/helm/v1alpha/scaffolds/edit.go:269:48: string `rbac` has 3 occurrences, make it a constant (goconst)
		{"config/rbac", "dist/chart/templates/rbac", "rbac"},
		                                             ^
pkg/plugins/optional/helm/v2alpha/scaffolds/internal/kustomize/templater/appliers/helpers.go:93:4: string `spec` has 4 occurrences, make it a constant (goconst)
		{"spec", "template", "spec", "containers"},
		 ^
pkg/plugins/optional/helm/v2alpha/scaffolds/internal/kustomize/templater/templater_test.go:38:22: string `test-project` has 7 occurrences, make it a constant (goconst)
			detectedPrefix:   "test-project",
			                  ^
pkg/plugins/optional/helm/v2alpha/scaffolds/internal/kustomize/templater/templater_test.go:3804:36: string `infrastructure` has 4 occurrences, make it a constant (goconst)
				"manager-role-infrastructure": "infrastructure",
				                               ^
pkg/plugins/optional/helm/v2alpha/scaffolds/internal/kustomize/templater/templater_test.go:3805:36: string `users` has 3 occurrences, make it a constant (goconst)
				"manager-role-users":          "users",
				                               ^
pkg/plugins/optional/helm/v2alpha/scaffolds/internal/kustomize/templater/templater_test.go:3909:5: string `manager-role` has 3 occurrences, make it a constant (goconst)
				"manager-role": "app-infrastructure",
				^
50 issues:
* goconst: 50
``

min-occurrences: 5
govet:
Comment thread
camilamacedo86 marked this conversation as resolved.
Comment thread
dongjiang1989 marked this conversation as resolved.
disable:
- fieldalignment
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ KUBE_LINTER ?= $(LOCALBIN)/kube-linter

## Tool Versions
GO_APIDIFF_VERSION ?= v0.8.3
GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_LINT_VERSION ?= v2.12.1
KUBE_LINTER_VERSION ?= v0.8.3

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# with all the plugins listed below.
#
# See: https://golangci-lint.run/plugins/module-plugins/
version: v2.11.4
version: v2.12.1
plugins:
# logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs)
- module: "sigs.k8s.io/logtools"
Expand Down
3 changes: 3 additions & 0 deletions docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ linters:
logcheck:
type: "module"
description: Checks Go logging calls for Kubernetes logging conventions.
goconst:
ignore-tests: true
min-occurrences: 5
Copy link
Copy Markdown
Contributor

@vitorfloriano vitorfloriano May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the goal of this config is to reduce noise from test files and we are already ignoring the tests, is min-ocurrences: 5 still necessary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min-ocurrences also applies to non-test files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...so the summary in the description is a bit misleading. In regards to this config, I favor explicitly adding no-lint directives to ocurrences than silently ignoring them. Also, a minimum of 5 seems a bit too much, doesn't it? It may solve problems at hand, but might also hide ocurrences in the long run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Agreed on both points.

• I’ll lower min-occurrences to 3.

• For specific cases, we’ll use explicit //nolint directives instead of silent ignores

WDYT? Default value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final offer: min of 2, take it or leave it!

Just kidding. Let's wait and hear what @camilamacedo86 has to say.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that we should ignore goconst
We need to fix the places where the error is raised instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I'll remove min-occurrences

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am concern with the changes in the default scaffold.
What are the places that fails in the default scaffold?
Are too many? If not I think we should solve it out

revive:
rules:
- name: comment-spacings
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/testdata/project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')

GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_LINT_VERSION ?= v2.12.1
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# with all the plugins listed below.
#
# See: https://golangci-lint.run/plugins/module-plugins/
version: v2.11.4
version: v2.12.1
plugins:
# logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs)
- module: "sigs.k8s.io/logtools"
Expand Down
3 changes: 3 additions & 0 deletions docs/book/src/getting-started/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ linters:
logcheck:
type: "module"
description: Checks Go logging calls for Kubernetes logging conventions.
goconst:
ignore-tests: true
min-occurrences: 5
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we should add it at all and change the golang ci config for the default scaffold, could we revert this change?

Copy link
Copy Markdown
Member Author

@dongjiang1989 dongjiang1989 May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm.... The lint rules in samples are broader in scope than those in golangci-linter default value(remove it). 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in the sample because the default scaffold was changed.
We should not change the default scaffold config unless it is really required

revive:
rules:
- name: comment-spacings
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/getting-started/testdata/project/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')

GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_LINT_VERSION ?= v2.12.1
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# with all the plugins listed below.
#
# See: https://golangci-lint.run/plugins/module-plugins/
version: v2.11.4
version: v2.12.1
plugins:
# logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs)
- module: "sigs.k8s.io/logtools"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ linters:
logcheck:
type: "module"
description: Checks Go logging calls for Kubernetes logging conventions.
goconst:
ignore-tests: true
min-occurrences: 5
revive:
rules:
- name: comment-spacings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')

GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_LINT_VERSION ?= v2.12.1
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func importantFile(p string) bool {
}

// Critical Kubebuilder files
//nolint:goconst

if p == "go.mod" || p == "Makefile" || p == "Dockerfile" {
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (r *{{ .Resource.Kind }}Reconciler) Reconcile(ctx context.Context, req ctrl
}

if len({{ lower .Resource.Kind }}.Status.Conditions) == 0 {
//nolint:goconst
Comment thread
dongjiang1989 marked this conversation as resolved.
Outdated
meta.SetStatusCondition(&{{ lower .Resource.Kind }}.Status.Conditions, metav1.Condition{Type: typeAvailable{{ .Resource.Kind }}, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
if err = r.Status().Update(ctx, {{ lower .Resource.Kind }}); err != nil {
log.Error(err, "Failed to update {{ .Resource.Kind }} status")
Expand Down
1 change: 1 addition & 0 deletions pkg/plugins/golang/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
)

var coreGroups = map[string]string{
//nolint:goconst
Comment thread
dongjiang1989 marked this conversation as resolved.
Outdated
"admission": "k8s.io",
"admissionregistration": "k8s.io",
"apps": "",
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/golang/v4/scaffolds/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (

const (
// GolangciLintVersion is the golangci-lint version to be used in the project
GolangciLintVersion = "v2.11.4"
GolangciLintVersion = "v2.12.1"
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
ControllerRuntimeVersion = "v0.24.0"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ linters:
logcheck:
type: "module"
description: Checks Go logging calls for Kubernetes logging conventions.
goconst:
ignore-tests: true
min-occurrences: 5
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please revert it?
Then run make install and make generate ro regenerate all samples and etc?
We should not change the rules for what is scaffold by the tool

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @camilamacedo86
Remove it many errors.

Do you mind if I remove it in the next PR to keep the scope of code changes smaller for this PR?

revive:
rules:
- name: comment-spacings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path/filepath"
"regexp"
"slices"
"strings"

"sigs.k8s.io/kubebuilder/v4/pkg/machinery"
Expand Down Expand Up @@ -155,8 +156,8 @@ func (f *WebhookTestUpdater) addVariableToBlock(content, varName, typeName strin
// detectIndentationInBlock extracts indentation from existing code
func (f *WebhookTestUpdater) detectIndentationInBlock(blockContent string) string {
lines := strings.Split(blockContent, "\n")
for i := len(lines) - 1; i >= 0; i-- {
line := lines[i]
for _, v := range slices.Backward(lines) {
line := v
trimmed := strings.TrimSpace(line)
if trimmed != "" && trimmed != "var" && trimmed != "(" {
trimmedLeft := strings.TrimLeft(line, " \t")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package appliers
import (
"fmt"
"regexp"
"slices"
"strconv"
"strings"

Expand Down Expand Up @@ -1340,8 +1341,8 @@ func detectChildIndent(lines []string, parentIndent string) string {
// Scan backwards to find the first child entry with indentation > parent
parentIndentLen := len(parentIndent)

for i := len(lines) - 1; i >= 0; i-- {
line := lines[i]
for _, v := range slices.Backward(lines) {
line := v
trimmed := strings.TrimSpace(line)

// Skip empty lines and Helm template directives
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package appliers

import (
"regexp"
"slices"
"strconv"
"strings"

Expand Down Expand Up @@ -256,8 +257,8 @@ func extractKeysFromLines(lines []string) []string {

// Find section start by scanning backwards to the nearest header
sectionStart := 0
for i := len(lines) - 1; i >= 0; i-- {
trimmed := strings.TrimSpace(lines[i])
for i, v := range slices.Backward(lines) {
trimmed := strings.TrimSpace(v)
// Stop at section headers - this is where our current section began
if trimmed == common.YamlKeyLabels || trimmed == common.YamlKeyAnnotations {
sectionStart = i + 1 // Start extracting from the line after the header
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/.custom-gcl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# with all the plugins listed below.
#
# See: https://golangci-lint.run/plugins/module-plugins/
version: v2.11.4
version: v2.12.1
plugins:
# logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs)
- module: "sigs.k8s.io/logtools"
Expand Down
3 changes: 3 additions & 0 deletions testdata/project-v4-multigroup/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ linters:
logcheck:
type: "module"
description: Checks Go logging calls for Kubernetes logging conventions.
goconst:
ignore-tests: true
min-occurrences: 5
revive:
rules:
- name: comment-spacings
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')

GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_LINT_VERSION ?= v2.12.1
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (r *BusyboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
}

if len(busybox.Status.Conditions) == 0 {
//nolint:goconst
meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the error here?
What is the value that the linter is asking for a const?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref: https://github.com/kubernetes-sigs/kubebuilder/actions/runs/25423812234/job/74572117344

goconst default value:

linters:
  settings:
    goconst:
      # Minimal length of string constant.
      # Default: 3
      min-len: 2
      # Minimum occurrences of constant string count to trigger issue.
      # Default: 3
      min-occurrences: 2
      # Look for existing constants matching the values.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need to check it properly.
How are we linting the samples?
Are we using the lint from samples or Kubebuilder config?
We should not change the config in the default scaffold.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @camilamacedo86
Using the lint config from samples; the lint rules in samples are broader in scope than those in golangci-linter default value.

if err = r.Status().Update(ctx, busybox); err != nil {
log.Error(err, "Failed to update Busybox status")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
}

if len(memcached.Status.Conditions) == 0 {
//nolint:goconst
meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
if err = r.Status().Update(ctx, memcached); err != nil {
log.Error(err, "Failed to update Memcached status")
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-plugins/.custom-gcl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# with all the plugins listed below.
#
# See: https://golangci-lint.run/plugins/module-plugins/
version: v2.11.4
version: v2.12.1
plugins:
# logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs)
- module: "sigs.k8s.io/logtools"
Expand Down
3 changes: 3 additions & 0 deletions testdata/project-v4-with-plugins/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ linters:
logcheck:
type: "module"
description: Checks Go logging calls for Kubernetes logging conventions.
goconst:
ignore-tests: true
min-occurrences: 5
revive:
rules:
- name: comment-spacings
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')

GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_LINT_VERSION ?= v2.12.1
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (r *BusyboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
}

if len(busybox.Status.Conditions) == 0 {
//nolint:goconst
meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
if err = r.Status().Update(ctx, busybox); err != nil {
log.Error(err, "Failed to update Busybox status")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
}

if len(memcached.Status.Conditions) == 0 {
//nolint:goconst
meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
if err = r.Status().Update(ctx, memcached); err != nil {
log.Error(err, "Failed to update Memcached status")
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/.custom-gcl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# with all the plugins listed below.
#
# See: https://golangci-lint.run/plugins/module-plugins/
version: v2.11.4
version: v2.12.1
plugins:
# logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs)
- module: "sigs.k8s.io/logtools"
Expand Down
3 changes: 3 additions & 0 deletions testdata/project-v4/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ linters:
logcheck:
type: "module"
description: Checks Go logging calls for Kubernetes logging conventions.
goconst:
ignore-tests: true
min-occurrences: 5
revive:
rules:
- name: comment-spacings
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ENVTEST_K8S_VERSION ?= $(shell v='$(call gomodver,k8s.io/api)'; \
[ -n "$$v" ] || { echo "Set ENVTEST_K8S_VERSION manually (k8s.io/api replace has no tag)" >&2; exit 1; }; \
printf '%s\n' "$$v" | sed -E 's/^v?[0-9]+\.([0-9]+).*/1.\1/')

GOLANGCI_LINT_VERSION ?= v2.11.4
GOLANGCI_LINT_VERSION ?= v2.12.1
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
Expand Down
Loading