Chore: bump k8s deps to v0.35.6 and controller-runtime to v0.23.3 - #241
Chore: bump k8s deps to v0.35.6 and controller-runtime to v0.23.3#241anishbista60 wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
Also bumped golangci-lint to v2.12.2 in this PR (migrated One note on This is a pragmatic fix, not the most idiomatic long-term one: it embeds a nil |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #241 +/- ##
===========================================
- Coverage 62.49% 24.52% -37.97%
===========================================
Files 62 64 +2
Lines 4415 5227 +812
===========================================
- Hits 2759 1282 -1477
- Misses 1324 3713 +2389
+ Partials 332 232 -100
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8003464 to
64766f7
Compare
There was a problem hiding this comment.
3 issues found across 20 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="makefiles/dependency.mk">
<violation number="1" location="makefiles/dependency.mk:46">
P3: `make staticcheck` still uses any existing PATH binary, so developers with an older Staticcheck do not receive v0.7.0. Version-check the discovered binary and install the pinned release when it differs.</violation>
<violation number="2" location="makefiles/dependency.mk:65">
P2: `make lint` still accepts an arbitrary preinstalled golangci-lint, so the v2.12.2 upgrade is skipped on machines with an older binary. Check the discovered version and reinstall/use the pinned release on mismatch.</violation>
</file>
<file name=".golangci.yml">
<violation number="1" location=".golangci.yml:92">
P3: Future instances of these lint rules anywhere in the repository will be silently accepted, even after the current findings are addressed. Scope each temporary exception to affected paths or fix the known violations instead of excluding the diagnostic repo-wide.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
| endif | ||
|
|
||
| GOLANGCILINT_VERSION ?= v1.60.0 | ||
| GOLANGCILINT_VERSION ?= v2.12.2 |
There was a problem hiding this comment.
P2: make lint still accepts an arbitrary preinstalled golangci-lint, so the v2.12.2 upgrade is skipped on machines with an older binary. Check the discovered version and reinstall/use the pinned release on mismatch.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At makefiles/dependency.mk, line 65:
<comment>`make lint` still accepts an arbitrary preinstalled golangci-lint, so the v2.12.2 upgrade is skipped on machines with an older binary. Check the discovered version and reinstall/use the pinned release on mismatch.</comment>
<file context>
@@ -62,7 +62,7 @@ else
endif
-GOLANGCILINT_VERSION ?= v1.60.0
+GOLANGCILINT_VERSION ?= v2.12.2
.PHONY: golangci
</file context>
| set -e ;\ | ||
| echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\ | ||
| go install honnef.co/go/tools/cmd/staticcheck@v0.5.1 ;\ | ||
| go install honnef.co/go/tools/cmd/staticcheck@v0.7.0 ;\ |
There was a problem hiding this comment.
P3: make staticcheck still uses any existing PATH binary, so developers with an older Staticcheck do not receive v0.7.0. Version-check the discovered binary and install the pinned release when it differs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At makefiles/dependency.mk, line 46:
<comment>`make staticcheck` still uses any existing PATH binary, so developers with an older Staticcheck do not receive v0.7.0. Version-check the discovered binary and install the pinned release when it differs.</comment>
<file context>
@@ -43,7 +43,7 @@ ifeq (, $(shell which staticcheck))
set -e ;\
echo 'installing honnef.co/go/tools/cmd/staticcheck ' ;\
- go install honnef.co/go/tools/cmd/staticcheck@v0.5.1 ;\
+ go install honnef.co/go/tools/cmd/staticcheck@v0.7.0 ;\
}
STATICCHECK=$(GOBIN)/staticcheck
</file context>
| text: 'occurrences, make it a constant' | ||
| - linters: | ||
| - staticcheck | ||
| text: 'QF1008:' |
There was a problem hiding this comment.
P3: Future instances of these lint rules anywhere in the repository will be silently accepted, even after the current findings are addressed. Scope each temporary exception to affected paths or fix the known violations instead of excluding the diagnostic repo-wide.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .golangci.yml, line 92:
<comment>Future instances of these lint rules anywhere in the repository will be silently accepted, even after the current findings are addressed. Scope each temporary exception to affected paths or fix the known violations instead of excluding the diagnostic repo-wide.</comment>
<file context>
@@ -1,207 +1,135 @@
+ text: 'occurrences, make it a constant'
+ - linters:
+ - staticcheck
+ text: 'QF1008:'
+ - linters:
+ - staticcheck
</file context>
controller-runtime's conversion.NewWebhookHandler now takes a conversion.Registry; pass an empty one to preserve existing scheme-default conversion behavior. Signed-off-by: anish bista <anishbista053@gmail.com>
Signed-off-by: anish bista <anishbista053@gmail.com>
Signed-off-by: anish bista <anishbista053@gmail.com>
…ation crossplane-runtime's pkg/test.MockClient no longer implements controller-runtime's client.Client interface after the v0.23 bump (missing Apply), breaking compilation of every test that imports it. Add a minimal local mock.Client covering Get/Create/Update/Patch and switch all affected tests over to it. Signed-off-by: anish bista <anishbista053@gmail.com>
Migrate .golangci.yml to the v2 config schema, bump the golangci-lint-action to v8 (required for v2 support), and pin the version in CI and makefiles/dependency.mk. Bump the Dockerfile and Dockerfile.e2e base image to golang:1.25.12-alpine3.24 to match the go.mod Go version. Suppress a handful of pre-existing findings newly surfaced by v2's stricter defaults, to be addressed in a follow-up PR. Signed-off-by: anish bista <anishbista053@gmail.com>
staticcheck v0.5.1 fails to build under Go 1.25.12 (x/tools incompatibility); bump the CI/Makefile pin to v0.7.0, which builds and passes cleanly. Also exclude SA1019 in .golangci.yml so golangci-lint's staticcheck agrees with staticcheck.conf, which already ignores SA1019 repo-wide pending the CUE upgrade work. golangci-lint doesn't read staticcheck.conf, so without this it flags cmd/main.go's use of the deprecated GetEventRecorderFor - which can't be swapped for GetEventRecorder without an upstream crossplane-runtime change, since NewAPIRecorder still expects the old record.EventRecorder type. Signed-off-by: anish bista <anishbista053@gmail.com>
The k3d cluster version used by e2e and webhook-upgrade-validation, and the envtest kube-apiserver version used by unit tests, were still pinned to v1.31 even though go.mod now targets the v0.35 k8s.io line. Bump K3D_IMAGE_VERSION(S) in e2e.yaml, the k3d version in webhook-upgrade-validation.yml, and ENVTEST_K8S_VERSION in makefiles/const.mk (the value make test actually uses) to v1.35, and align unit-test.yaml's kubebuilder-action kubernetesVersion accordingly. go.mod/go.sum changes are from go mod tidy dropping a now-unused indirect dependency. Signed-off-by: anish bista <anishbista053@gmail.com>
Go 1.25.12's crypto/x509 rejects the hardcoded CA/server/client test certs in pkg/providers/http and pkg/providers/legacy/http/testdata because they were signed with SHA1-RSA, breaking TestHTTPSDo in CI. Regenerate all three as SHA256-signed certs (same CA covering server cert SAN 127.0.0.1 and a client cert for mTLS), verified against the actual handshake used by these tests. Once that let both packages' TLS tests actually reach the network layer, they collided: pkg/providers/http and pkg/providers/legacy/http hardcode the same ports (1229, 8443) and race when go test runs packages in parallel. Move the legacy package to distinct ports (1329/8543). Signed-off-by: anish bista <anishbista053@gmail.com>
7b85f34 to
db7336a
Compare
crossplane-runtime/v2's test.MockClient implements the Apply method controller-runtime v0.22+ requires on client.Client, so the local pkg/mock.Client workaround is no longer needed. Switch all imports to the v2 module and revert tests back to test.MockClient. Signed-off-by: anish bista <anishbista053@gmail.com>
db7336a to
b571dbc
Compare
Signed-off-by: anish bista <anishbista053@gmail.com> # Conflicts: # controllers/suite_test.go # go.mod # go.sum
pkg/executor now imports github.com/kubevela/pkg/cache (from the merged StepStatusCache refactor), which the previously pinned pkg fork commit predates. Signed-off-by: anish bista <anishbista053@gmail.com>
Points github.com/oam-dev/cluster-gateway at the latest commit on its replace-apiserver-runtime branch. apiserver-runtime was only ever an indirect, transitive dependency here (no source in this repo imports it), so once the upstream chain no longer needs it, go mod tidy drops it entirely. Signed-off-by: anish bista <anishbista053@gmail.com>
Summary by cubic
Upgrade Kubernetes deps to v0.35.6 and
sigs.k8s.io/controller-runtimeto v0.23.3, move builds/CI to Go 1.25.12, migrate togithub.com/crossplane/crossplane-runtime/v2, update the conversion webhook, align tests to Kubernetes v1.35, and fix TLS tests by switching to SHA256 certs and deconflicting test ports.Dependencies
k8s.io/api,k8s.io/apimachinery,k8s.io/client-go,k8s.io/apiextensions-apiserver,k8s.io/apiserver,k8s.io/component-base-> v0.35.6.sigs.k8s.io/controller-runtime-> v0.23.3.github.com/crossplane/crossplane-runtime/v2-> v2.3.3 (imports updated; tests usepkg/testfrom v2).golangci-lint-> v2.12.2; action -> v8;.golangci.ymlmigrated to v2 (SA1019 excluded).staticcheck-> v0.7.0.github.com/kubevela/pkg); updatedgithub.com/oam-dev/cluster-gatewayreplace and dropped the indirectapiserver-runtimereplace.Migration
conversion.NewWebhookHandler(scheme, conversion.NewRegistry()). If you maintain custom conversions, migrate to theconversion.Registrypattern.Written for commit e7e13c2. Summary will update on new commits.