KubeContext in KubeConfClientOptions not working
Riohyc opened this issue · comments
Riohyc commented
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
- Set
KubeConfClientOptions.KubeContext
to what I want to use. - Build client by
NewClientFromKubeConf
. - 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
- Load kubeconfig to
api.Config
and setCurrentContext
to what I want. - Load
api.Config
torest.Config
- Build client by
NewClientFromRestConf
.
Looks like KubeConfClientOptions.KubeContext
do not change the behavior of RESTClientGetter
creating any k8s client