mittwald / go-helm-client

Go client for accessing the Helm package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KubeContext in KubeConfClientOptions not working

Riohyc opened this issue · comments

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