-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Bearer Token is ignored by action.Configuration #8844
Comments
It breaks Helm client, cli-runtime etc. Please see [here](helm/helm#8844)
@debarshibasak thanks for finding this. |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs. |
I also meet it today lol. The bug seems still exist on the master branch (@v0.28.3) when host starts with http. |
Solved by using WrapConfigFn which was added in the commit kubernetes/kubernetes@211fc12 clientConfig = new(genericclioptions.ConfigFlags)
clientConfig.APIServer = "..."
clientConfig.BearerToken = "..."
clientConfig.WrapConfigFn = func(c *rest.Config) *rest.Config{
c.clientConfig = *clientConfig.BearerToken
return c
}
// restConfig := clientConfig.ToRESTConfig() |
Note: This is not a helm bug, It is a k8s cli-runtime bug but it impacts helm. I am creating this issue as I am using this as reference in cli-runtime's issue.
see here and also here
While initializing genericclioptions.ConfigFlags with bearer Token, it is ignored during actionConfig.Init.
For Instance,
If you output
actionCfg.RESTClientGetter.ToRESTConfig()..BearerToken
, it is empty. Therefore when helmClient is trying to perform any action, it fails.I think it seems to be a kubernetes cli-runtime and clientcmd bug.
A workaround for solving this bug is to patch
k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go
. Assign config's BearerToken with the flag's value.Output of
helm version
: 3.3.4Output of
kubectl version
: 1.19.xCloud Provider/Platform (AKS, GKE, Minikube etc.):
All platforms
The text was updated successfully, but these errors were encountered: