Repository navigation
chore: bump go to 1.27.1, k8s deps to v0.37.1 and controller-runtime to v0.25.2 - #177
Conversation
…to v0.25.2 Part of kubevela/kubevela#7238. Go 1.25 is out of support, so the target moved to Go 1.27.1, k8s.io v0.37.x and controller-runtime v0.25.x. CI, Dockerfiles, kind (v0.33.0, node v1.37.0) and envtest (1.37.x) follow. k8s 1.37 types GenericAPIServer.Authorizer as UnconditionalAuthorizer, so the loopback holder now stores that narrower interface. Its only consumer, the proxy subresource, just calls Authorize. The openapi-gen pin follows kube-openapi, and zz_generated.openapi.go is regenerated. Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #177 +/- ##
==========================================
+ Coverage 32.15% 35.39% +3.23%
==========================================
Files 43 43
Lines 2264 1992 -272
==========================================
- Hits 728 705 -23
+ Misses 1476 1287 -189
+ Partials 60 0 -60
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:
|
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.
Fix all with cubic | Turn on auto-fix | Re-trigger cubic
client-gen v0.35.6 to v0.37.1 and controller-gen/controller-tools v0.17.3 to v0.22.0, keeping the go.mod controller-tools version aligned with the Makefile pin as oam-dev#176 did. Regenerates the clientset (Discovery() now returns discovery.DiscoveryInterfaces, matching client-go 0.37) and the CRD, with the chart copy kept in sync. Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
MutatingAdmissionPolicy is GA and on by default from k8s 1.36, so the generic apiserver's admission chain now starts informers on mutatingadmissionpolicies and mutatingadmissionpolicybindings. The gateway service account could not list or watch them, the informers never synced, and every write (for example the health subresource) failed with 403 "not yet ready to handle request". Add both resources to the standalone and addon-manager cluster roles and to the addon installer, the same way validating admission policies were added for k8s 1.30. Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
6ee2919 to
689c98a
Compare
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Turn on auto-fix | Re-trigger cubic
Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
* chore: bump k8s deps to v0.35.6 line and controller-runtime to v0.23.3 Implements the new client.Client/SubResourceWriter Apply method on the multicluster gated/remote client wrappers, and updates the apiutil.RESTClientForGVK call for its new isUnstructured parameter. Signed-off-by: anish bista <anishbista053@gmail.com> * chore: bump CI go version to 1.25.12 Signed-off-by: anish bista <anishbista053@gmail.com> * fix: repair golangci-lint bootstrap in Makefile golangci-lint's install.sh unanchored-greps the checksums file, so a release's .sbom.json entry falsely matches the linux-amd64 tarball entry and verification always fails even on a correct download. Use `go install` instead. Also fix `version --format short`, which v2 dropped in favor of `--short`, and make the `lint` target use the resolved $(GOLANGCILINT) path instead of assuming it's on PATH. Signed-off-by: anish bista <anishbista053@gmail.com> * chore: bump golangci-lint to v2.12.2 and update CI/config accordingly Migrate .golangci.yml to the v2 config schema, bump the CI Go version to 1.26.0, and refresh replace-directive pins in go.mod/go.sum. Use golangci-lint-action@v7 since v6 does not support golangci-lint v2. Signed-off-by: anish bista <anishbista053@gmail.com> * fix: avoid non-constant format string in externalserver test fmt.Errorf(in.V) treats a variable as the format string, which go vet flags. These values are plain error messages, not format strings, so use errors.New instead. Signed-off-by: anish bista <anishbista053@gmail.com> * chore: drop sigs.k8s.io/apiserver-runtime dependency util/singleton's GenericAPIServer singleton only ever needed builder.GenericAPIServer for its type — that's a literal Go type alias for k8s.io/apiserver/pkg/server.GenericAPIServer, so importing k8s.io/apiserver/pkg/server directly instead is a zero-behavior-change diff, not a real dependency. Drops one of the two remaining apiserver-runtime consumers in the KubeVela ecosystem (see the community thread on replacing kmodules/apiserver-runtime, which is a fork of the unmaintained kubernetes-sigs/apiserver-runtime). cluster-gateway and prism, which have real coupling to the framework (bootstrap + resource registration), are being migrated separately. Signed-off-by: anish bista <anishbista053@gmail.com> * chore: bump cluster-gateway replace to latest apiserver-runtime replacement commit Points the github.com/oam-dev/cluster-gateway replace at anishbista60/cluster-gateway@06bb4f3, the latest commit on the replace-apiserver-runtime branch (includes the --feature-gates flag fix found via CI). This also drops sigs.k8s.io/apiserver-runtime from pkg's dependency graph entirely, since that commit no longer pulls it in transitively either. Signed-off-by: anish bista <anishbista053@gmail.com> * chore: bump go to 1.27.1 and k8s deps to v0.37.1 Moves the targets from Go 1.25 / k8s 0.35 to Go 1.27.1 / k8s 0.37.1, since Go 1.25 is out of support now that 1.27 has shipped. - k8s.io libs v0.37.1, controller-runtime v0.25.2, controller-tools v0.22.0 - drop the cluster-gateway fork replace; oam-dev/cluster-gateway#177 is merged, so require upstream master until a release is tagged - CI and env-setup Go 1.27.1, golangci-lint v2.14.0, envtest 1.37.0 - regenerate CRDs with controller-gen v0.22.0 Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com> * feat(multicluster): support server-side apply on remote clusters Apply and ApplySubResource on remoteClusterClient returned an error for any non-local cluster, while every other verb proxies through cluster-gateway. Send the apply request through the same rest client instead, mirroring the controller-runtime typed client, and decode the response into the apply configuration. Tests cover Apply, Status().Apply and SubResource().Apply on the gated client and on the remote client for both local and managed clusters. The test gateway handler now forwards the query string, which apply needs for fieldManager. Also bump the kubebuilder-action kubernetesVersion to v1.37.0, in line with the earlier k8s bumps (#109, #116, #117). Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com> * fix(multicluster): accept charset-qualified JSON in remote apply responses Compare the media type instead of the raw Content-Type header, so a proxy answering with application/json; charset=utf-8 doesn't turn a successful apply into an error. The remote client test now serves charset-qualified JSON during the managed-cluster apply pass. Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com> --------- Signed-off-by: anish bista <anishbista053@gmail.com> Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com> Co-authored-by: anish bista <anishbista053@gmail.com>
Part of kubevela/kubevela#7238.
Go 1.25 went out of support when Go 1.27 was released, so the ecosystem bump now targets Go 1.27.1, k8s.io v0.37.x and controller-runtime v0.25.x. This builds on #176, which moved the apiserver to canonical
k8s.io/apiserverat v0.35.6.Dependency changes:
go1.25.13 to 1.27.1k8s.io/{api,apimachinery,apiserver,client-go,component-base,kube-aggregator,apiextensions-apiserver}v0.35.x to v0.37.1sigs.k8s.io/controller-runtimev0.23.3 to v0.25.2k8s.io/kube-openapifollows tov0.0.0-20260721132016-d427ff9ee9ad, and the Makefile'sopenapi-genpin moves to the same revision so generated code matches the runtime libraryclient-genv0.35.6 to v0.37.1, andcontroller-genplus the go.modsigs.k8s.io/controller-toolsv0.17.3 to v0.22.0, kept aligned as in Replace apiserver runtime #176. controller-tools v0.22.0 brings newer ginkgo/gomega and some golang.org/x minor bumps through MVSCode change:
GenericAPIServer.Authorizeris typedauthorizer.UnconditionalAuthorizer. The fullauthorizer.Authorizerinterface now also requiresConditionsAwareAuthorizeandEvaluateConditionsfor conditional authorization. Thepkg/util/loopbackholder now stores and returnsUnconditionalAuthorizer. Its only consumer, the proxy subresource inclustergateway_proxy.go, only callsAuthorize, so behaviour does not change. The loopback test now uses an authorizer that implements onlyAuthorize, which is the shape the generic server hands over. The test failed to compile before the change.RBAC fix for k8s 1.36+ (found by the e2e run on the first commit):
k8s.io/apiserverv0.37 feature gate defaulttrue). The generic apiserver's admission chain therefore starts informers onmutatingadmissionpoliciesandmutatingadmissionpolicybindings. The gateway service account could not list or watch them, so the informers never synced, and every write through admission failed with403 not yet ready to handle request. In e2e that showed up as the healthiness and health-probe specs failing while GET/LIST passed, and the OCM addon specs failing.charts/cluster-gatewayandcharts/addon-managercluster roles and tonewAPFClusterRoleinpkg/addon/controllers/installer.go. This mirrors how validating admission policies were added for k8s 1.30. A new unit test checks the addon cluster role covers every admission resource the default plugins watch.Generated code:
pkg/apis/generated/zz_generated.openapi.gois regenerated bymake testwith the new openapi-gen. It drops emptyDefaultvalues on array items and adds the new metav1ShardInfomodel.cmd/apiserver/main.gochanges only bygo fmtalignment of one map key.Discovery()now returnsdiscovery.DiscoveryInterfaces, the same as client-go 0.37's ownkubernetes.Clientset. It embedsDiscoveryInterface, so callers are unaffected. Only hand-written fakes ofversioned.Interfacewould need the new signature, and none exist in this repo.charts/addon-manager/crds/clustergatewayconfigurations.yamlis kept identical tohack/crd/bases/....CI and images:
GO_VERSIONinci.yamlandgo-release.yml, plus both Dockerfiles, move to Go 1.27.1 (golang:1.27.1,golang:1.27.1-alpine)kindest/node:v1.37.0for both the standalone and OCM e2e jobs1.35.xto1.37.xVerified locally with go1.27.1:
go build ./...,go vet ./...make testwith envtest 1.37.0 assets passes (generate, generate-openapi, fmt, vet, manifests,go test ./pkg/...)Once this merges, a release tag would unblock kubevela/pkg, which currently has to
replacecluster-gateway with a fork. The last tag is v1.9.1, from May 2025.