Skip to content

chore: bump go to 1.27.1, k8s deps to v0.37.1 and controller-runtime to v0.25.2 - #177

Merged
briankane merged 6 commits into
oam-dev:masterfrom
roguepikachu:chore/bump-go1.27-k8s0.37
Oct 7, 2026
Merged

briankane merged 6 commits into
oam-dev:masterfrom
roguepikachu:chore/bump-go1.27-k8s0.37

Conversation

@roguepikachu

@roguepikachu roguepikachu commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

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/apiserver at v0.35.6.

Dependency changes:

  • go 1.25.13 to 1.27.1
  • k8s.io/{api,apimachinery,apiserver,client-go,component-base,kube-aggregator,apiextensions-apiserver} v0.35.x to v0.37.1
  • sigs.k8s.io/controller-runtime v0.23.3 to v0.25.2
  • k8s.io/kube-openapi follows to v0.0.0-20260721132016-d427ff9ee9ad, and the Makefile's openapi-gen pin moves to the same revision so generated code matches the runtime library
  • Code generators move to the k8s 0.37 line: client-gen v0.35.6 to v0.37.1, and controller-gen plus the go.mod sigs.k8s.io/controller-tools v0.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 MVS

Code change:

  • In k8s 1.37, GenericAPIServer.Authorizer is typed authorizer.UnconditionalAuthorizer. The full authorizer.Authorizer interface now also requires ConditionsAwareAuthorize and EvaluateConditions for conditional authorization. The pkg/util/loopback holder now stores and returns UnconditionalAuthorizer. Its only consumer, the proxy subresource in clustergateway_proxy.go, only calls Authorize, so behaviour does not change. The loopback test now uses an authorizer that implements only Authorize, 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):

  • MutatingAdmissionPolicy is GA and on by default from k8s 1.36 (k8s.io/apiserver v0.37 feature gate default true). The generic apiserver's admission chain therefore starts informers on mutatingadmissionpolicies and mutatingadmissionpolicybindings. The gateway service account could not list or watch them, so the informers never synced, and every write through admission failed with 403 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.
  • Both resources are added (get/list/watch) to charts/cluster-gateway and charts/addon-manager cluster roles and to newAPFClusterRole in pkg/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.go is regenerated by make test with the new openapi-gen. It drops empty Default values on array items and adds the new metav1 ShardInfo model.
  • cmd/apiserver/main.go changes only by go fmt alignment of one map key.
  • The clientset is regenerated with client-gen v0.37.1. Discovery() now returns discovery.DiscoveryInterfaces, the same as client-go 0.37's own kubernetes.Clientset. It embeds DiscoveryInterface, so callers are unaffected. Only hand-written fakes of versioned.Interface would need the new signature, and none exist in this repo.
  • The CRD is regenerated with controller-gen v0.22.0; only the version annotation changes. charts/addon-manager/crds/clustergatewayconfigurations.yaml is kept identical to hack/crd/bases/....

CI and images:

  • GO_VERSION in ci.yaml and go-release.yml, plus both Dockerfiles, move to Go 1.27.1 (golang:1.27.1, golang:1.27.1-alpine)
  • e2e: kind v0.32.0 to v0.33.0, node image kindest/node:v1.37.0 for both the standalone and OCM e2e jobs
  • envtest assets 1.35.x to 1.37.x

Verified locally with go1.27.1:

  • go build ./..., go vet ./...
  • make test with 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 replace cluster-gateway with a fork. The last tag is v1.9.1, from May 2025.

…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

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.39%. Comparing base (8ff085a) to head (036a312).

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     
Flag Coverage Δ
unit-test 35.39% <100.00%> (+3.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread Makefile
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>
@roguepikachu
roguepikachu force-pushed the chore/bump-go1.27-k8s0.37 branch from 6ee2919 to 689c98a Compare October 7, 2026 05:52

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread cmd/apiserver/main.go Outdated
Signed-off-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
@briankane
briankane merged commit da74b30 into oam-dev:master Oct 7, 2026
8 checks passed
briankane pushed a commit to kubevela/pkg that referenced this pull request Oct 8, 2026
* 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>
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.

2 participants