Skip to content
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

KubeContext in KubeConfClientOptions not working #127

Open
Riohyc opened this issue Oct 12, 2022 · 0 comments
Open

KubeContext in KubeConfClientOptions not working #127

Riohyc opened this issue Oct 12, 2022 · 0 comments

Comments

@Riohyc
Copy link

Riohyc commented Oct 12, 2022

I had a kubeconfig byte with multiple contexts and current-context in kubeconfig is not what I want to used when build a helm client.

What I expected

  1. Set KubeConfClientOptions.KubeContext to what I want to use.
  2. Build client by NewClientFromKubeConf.
  3. All operation execute by the client should use the context set in step1

What actually happen

All operation execute by the client should still use the original context in kubeconfig

What I do to workaroud

  1. Load kubeconfig to api.Config and set CurrentContext to what I want.
  2. Load api.Config to rest.Config
  3. Build client by NewClientFromRestConf.

Looks like KubeConfClientOptions.KubeContext do not change the behavior of RESTClientGetter creating any k8s client

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

No branches or pull requests

1 participant