Skip to content

fix(lint): replace deprecated Requeue/TemplateRef usages flagged by staticcheck - #48

Merged
tjjh89017 merged 3 commits into
mainfrom
fix/lint-staticcheck-deprecated
Aug 24, 2026
Merged

fix(lint): replace deprecated Requeue/TemplateRef usages flagged by staticcheck#48
tjjh89017 merged 3 commits into
mainfrom
fix/lint-staticcheck-deprecated

Conversation

@tjjh89017

Copy link
Copy Markdown
Owner

Fixes the CI failure in https://github.com/tjjh89017/vrouter-operator/actions/runs/32697782255

golangci-lint's staticcheck now flags:

  • ctrl.Result{Requeue: true} (deprecated, use RequeueAfter) in three controllers
  • VRouterBindingSpec.TemplateRef usage in tests not exercising the deprecated-field fallback path

Changes

  • Switch the finalizer-add requeue sites to RequeueAfter: time.Millisecond, matching the RequeueAfter-only convention already used elsewhere in these controllers.
  • In vrouterbinding_controller_test.go, switch the generic reconcile test to TemplateRefs, and add nolint justifications on the two tests that deliberately exercise the deprecated TemplateRef fallback behavior.

Verification

  • go build ./..., go vet ./... — clean
  • bin/golangci-lint run ./... — clean (no more staticcheck issues)
  • make test — all packages pass

…taticcheck

golangci-lint's staticcheck now flags:
- ctrl.Result{Requeue: true} (deprecated, use RequeueAfter)
- VRouterBindingSpec.TemplateRef in tests not exercising the
  deprecated-field fallback path

Switch the finalizer-add requeue sites to RequeueAfter: time.Millisecond,
matching the RequeueAfter-only convention already used elsewhere in these
controllers. In the test file, switch the generic reconcile test to
TemplateRefs and add nolint justifications on the two tests that
deliberately exercise the deprecated TemplateRef fallback behavior.

Signed-off-by: Date Huang <tjjh89017@hotmail.com>
golangci-lint's staticcheck flagged one more TemplateRef usage in
vrouterbinding_controller_test.go (the namespace-preservation test)
that was missed in the previous commit; it also deliberately exercises
the deprecated TemplateRef fallback path.

Signed-off-by: Date Huang <tjjh89017@hotmail.com>
The manager-e2e BeforeAll used a bare 'kubectl create ns', which fails
with AlreadyExists when Ginkgo's randomized suite order runs
kubevirt-e2e or rollout-e2e first — their 'make deploy' already creates
the operator namespace. Create the namespace via
'create --dry-run=client -o yaml | kubectl apply -f -' so the suite
passes regardless of ordering.

Signed-off-by: Date Huang <tjjh89017@hotmail.com>
@tjjh89017
tjjh89017 merged commit 3d5efb6 into main Aug 24, 2026
6 checks passed
@tjjh89017
tjjh89017 deleted the fix/lint-staticcheck-deprecated branch August 24, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant