fix(lint): replace deprecated Requeue/TemplateRef usages flagged by staticcheck - #48
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, useRequeueAfter) in three controllersVRouterBindingSpec.TemplateRefusage in tests not exercising the deprecated-field fallback pathChanges
RequeueAfter: time.Millisecond, matching theRequeueAfter-only convention already used elsewhere in these controllers.vrouterbinding_controller_test.go, switch the generic reconcile test toTemplateRefs, and addnolintjustifications on the two tests that deliberately exercise the deprecatedTemplateReffallback behavior.Verification
go build ./...,go vet ./...— cleanbin/golangci-lint run ./...— clean (no more staticcheck issues)make test— all packages pass