Skip to content

deps: upgrade k8s.io/client-go from v0.35.2 to v0.36.0#3408

Open
anithapriyanatarajan wants to merge 1 commit intotektoncd:mainfrom
anithapriyanatarajan:fix-k8s-client-version
Open

deps: upgrade k8s.io/client-go from v0.35.2 to v0.36.0#3408
anithapriyanatarajan wants to merge 1 commit intotektoncd:mainfrom
anithapriyanatarajan:fix-k8s-client-version

Conversation

@anithapriyanatarajan
Copy link
Copy Markdown
Contributor

Changes

deps: upgrade k8s.io/client-go from v0.35.2 to v0.36.0

Summary

Upgrades k8s.io/client-go from v0.35.2 to v0.36.0 and aligns all k8s.io/* packages to the same v0.36.0 release. This keeps the operator dependency stack current with the Kubernetes 1.36 release cycle.

Fixes: SRVKP-11558 by consuming the commit

Background:

why the replace directive exists

go.mod uses a replace directive to override k8s.io/client-go to the v0.36.0:

replace k8s.io/client-go => k8s.io/client-go v0.36.0

This is intentional. Several of our transitive dependencies (openshift/client-go, openshift/library-go, openshift/apiserver-library-go) still declare k8s.io/client-go v0.35.x in their own go.mod. Go's Minimum Version Selection (MVS) would otherwise select the highest version requested across the whole module graph — but without this override, the ancient placeholder version v1.5.2 (from the 2016-era pre-semver release of client-go) would win, since v1.5.2 > v0.36.0 in semver. The replace directive (with no left-side version, meaning it overrides all versions) ensures the build always uses the modern v0.36.0. It can be removed once the OpenShift packages ship new pseudo-versions that themselves declare >= v0.36.0.

What was blocking this upgrade

k8s.io/api v0.36.0 deleted three Go packages that had been long deprecated at the server level:

Deprecated Kubernetes Packages

Deleted package Deprecated since Server-removed
k8s.io/api/autoscaling/v2beta1 Kubernetes 1.12 Kubernetes 1.26
k8s.io/api/autoscaling/v2beta2 Kubernetes 1.23 Kubernetes 1.26
k8s.io/api/scheduling/v1alpha1 Kubernetes 1.10 Kubernetes 1.17

Because Go resolves a single version of k8s.io/api across the entire module graph, any project depending on a library that still imports these packages will hit a hard compile-time failure:

k8s.io/api/autoscaling/v2beta1: module k8s.io/api@v0.36.0 found, but does not contain package k8s.io/api/autoscaling/v2beta1
Two upstream fixes were required before this upgrade could land:

  1. knative/pkg: PR #3353 ✅ Merged
    Commit: df317a52d112 → published as pseudo-version v0.0.0-20260507212125-df317a52d112

knative/pkg's webhook/testing/listers.go imported k8s.io/api/autoscaling/v2beta1 and k8s.io/client-go/listers/autoscaling/v2beta1. This caused a build failure for any consumer (including this operator) that resolved k8s.io/api >= v0.36.0. The PR replaced both with their stable autoscaling/v2 equivalents.

This PR bumps knative.dev/pkg from v0.0.0-20260319144801-8c68e18a5cc7 → v0.0.0-20260507212125-df317a52d112 to pick up that fix.

  1. openshift/api: PR #2834 ✅ Merged
    Commit: 2955bfa26c43 → published as pseudo-version v0.0.0-20260507124924-2955bfa26c43

openshift/api's install.go imported and registered autoscaling/v2beta1, autoscaling/v2beta2, and scheduling/v1alpha1 via AddToScheme. Because openshift/api is a direct dependency of this operator, any upgrade to k8s.io/api >= v0.36.0 would fail to compile without this fix. The PR removed the three deleted imports and their AddToScheme registrations along with the corresponding vendored directories (the stable replacements autoscaling/v2 and scheduling/v1 were already registered and are unchanged).

This PR bumps github.com/openshift/api from v0.0.0-20260429122012-1180c0f5c3e9 → v0.0.0-20260507124924-2955bfa26c43 to pick up that fix.

Version Change Summary

Dependency Before After
k8s.io/client-go v0.35.2 (via replace) v0.36.0 (via replace)
k8s.io/api v0.35.4 v0.36.0
k8s.io/apimachinery v0.35.4 v0.36.0
k8s.io/apiextensions-apiserver v0.35.4 v0.36.0
k8s.io/apiserver v0.35.4 v0.36.0
k8s.io/code-generator v0.35.4 v0.36.0
k8s.io/component-base v0.35.4 v0.36.0
k8s.io/kube-aggregator v0.35.2 v0.36.0
knative.dev/pkg v0.0.0-20260319144801-8c68e18a5cc7 v0.0.0-20260507212125-df317a52d112
github.com/openshift/api v0.0.0-20260429122012-1180c0f5c3e9 v0.0.0-20260507124924-2955bfa26c43

Follow-up
The replace k8s.io/client-go directive can be removed once openshift/client-go, openshift/library-go, and openshift/apiserver-library-go publish new pseudo-versions that declare k8s.io/client-go >= v0.36.0 natively, at which point MVS will select v0.36.0 without an override.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

NONE

Assisted-by: Copilot Agent using Claude-Sonnet 4.6 model

/kind misc

Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
@tekton-robot tekton-robot added kind/misc Categorizes issue or PR as a miscellaneuous one. release-note-none Denotes a PR that doesnt merit a release note. labels May 8, 2026
@tekton-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from anithapriyanatarajan after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/misc Categorizes issue or PR as a miscellaneuous one. release-note-none Denotes a PR that doesnt merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants