Skip to content

fix(auth): ensure OIDC auth plugin is included in compiled binary #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025

Conversation

ziadmoubayed
Copy link
Contributor

Summary:

This PR fixes startup failures when the server is pointed at clusters that authenticate with OIDC.
We add a single side-effect import:

import _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"

which registers the OIDC plug-in at init() time so that client-go can recognise the auth-provider: oidc stanza found in many kubeconfigs.

Motivation:

Running npx [email protected] against an OIDC-backed cluster produced:

Failed to initialize MCP server: no Auth Provider found for name "oidc"

@ziadmoubayed
Copy link
Contributor Author

I am not a go expert. Please let me know if the import should be place somewhere else

Copy link
Owner

@manusa manusa left a comment

Choose a reason for hiding this comment

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

Thx! This is awesome (maybe we want to add other plugins too).

I am not a go expert. Please let me know if the import should be place somewhere else

To keep things in the same domain package, maybe it's better if we add the plugin import in between these lines:

"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

and remove it from the cmd/root.go

could you please check if this works too?

@manusa manusa self-assigned this May 29, 2025
@manusa manusa added this to the 0.1.0 milestone May 29, 2025 — with automated-tasks
Copy link
Owner

@manusa manusa left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

@manusa manusa merged commit 714d2ba into manusa:main May 29, 2025
5 checks passed
@ziadmoubayed
Copy link
Contributor Author

ziadmoubayed commented Jun 2, 2025

Thx! This is awesome (maybe we want to add other plugins too).

I am not a go expert. Please let me know if the import should be place somewhere else

To keep things in the same domain package, maybe it's better if we add the plugin import in between these lines:

"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

and remove it from the cmd/root.go

could you please check if this works too?

Thanks for the review. I did a test today. It works now. Facing #83 unfortunately.

Continued the support in #105

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