fix: register client-go auth provider plugins - #670
Merged
Conversation
Signed-off-by: Ilya Drey <ilya.drey@flant.com>
ilya-lesikov
approved these changes
Jul 27, 2026
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.
Summary
Restores registration of client-go's bundled auth provider plugins by adding the
_ "k8s.io/client-go/plugin/pkg/client/auth"side-effect import topkg/kube/client_static.go.Without it, any kubeconfig relying on an auth provider plugin — notably
oidc— fails toconstruct a Kubernetes client on the v2 line.
Why
On v2, every command that talks to the cluster fails outright with an
oidckubeconfig:The same kubeconfig works on v1. Auth provider plugins in client-go register themselves via
package side effects, so something has to blank-import them. On
mainthat import lives inthe vendored Helm CLI entrypoint (
pkg/helm/cmd/helm/helm.go:30). The v2 line dropped thatcode, and with it the only import of the plugin package —
git grep 'plugin/pkg/client/auth'on branch
2returns nothing, so registration was silently lost. Nothing failed at build orinit time; the breakage only surfaces at client construction for users whose kubeconfig
actually needs a provider plugin.
Key changes
Auth provider registration —
pkg/kube/client_static.go_ "k8s.io/client-go/plugin/pkg/client/auth", re-registering client-go's bundled authprovider plugins.
pkg/kube(static, dynamic, discovery), not just
NewStaticKubeClientFromKubeConfig. The static clientis simply where the failure surfaces first, since
NewClientFactorybuilds it before theothers (
pkg/kube/factory.go:51).Review focus / risks
disappearing along with the file that held it.
client_static.gois a plausible spot, but amore obvious location (
pkg/kube/common.go, or a dedicatedauth_plugins.gowith a commentexplaining it must not be removed) would make it harder to drop again by accident.
in-tree providers (
gcp,azure,openstack) from this meta-package over past releases, sothis restores whatever the current version ships — verified to cover
oidcvia the reportederror, but it may not fully restore v1 behavior for users on the removed providers. Worth
checking the pinned version's package contents before assuming parity with v1.
guard would be a test asserting
rest.GetAuthProvider/the provider registry knowsoidc.release plan install— the fix isat the client-construction layer, so a single successful command is good evidence, but
confirming a full
release installexercises the token-refresh path too.execcredential plugins and in-cluster/certificate auth live inclient-go core and never needed registration, so this narrows strictly to the provider-plugin
path.