Repository navigation
feat(cli) Pass token via cli - #7230
Conversation
|
This is not my area, but I was trying to figure out if this new global flag may need to be handled in the completion logic. @waveywaves Could you describe in which use case a user would specify this flag? Am I right to assume it is to authenticate with kube cluster? |
|
I would find this useful. Thank you! How's the kube context / API Server specification going to work with this? I'm guessing that's picked up from the default kubeconfig context. In addition, is it possible to support something similar to the following for |
|
@marckhouzam Yes it will be used to authenticate as well as allow |
|
Thanks @waveywaves. So, I'm thinking about two aspects since this is a global flag:
For completion since this flag will affect how to connect with the cluster, it needs to be added to the completion override flag list here: Line 34 in 0fd76b2 For example, if you type the completion script will run a About plugins, should the token be made available for plugins to use? All the other global flags have a corresponding environment variable which allows to pass the value of the flag to the plugin. See Line 101 in 0fd76b2 Line 64 in 0fd76b2 Line 130 in 0fd76b2 |
|
Tested this out in a pod in an OpenShift cluster. Looks good. Verification: |
bd06ca3 to
71abfe1
Compare
|
@sbose78 Thank you for that, it does make more sense to have a --server option alongside token as well. Just added that to the PR as well. |
b8920ec to
9669602
Compare
|
@marckhouzam I have added correspoding Env Vars for the |
|
Nice patch. |
9669602 to
b7c18c3
Compare
|
@marckhouzam @bacongobbler I have made the necessary changes. |
|
Hi @waveywaves, it’s the holiday season right now. Probably won’t get to reviewing this until the second week of January. Thanks for your patience. |
|
@bacongobbler No worries. Have a good one :) |
|
closes #5159 |
|
@bacongobbler can you check this out ? Do I need to make any other changes ? |
|
@waveywaves you should be able to run |
|
Hi @waveywaves . Good news. With the merging of #7323 , you no longer need to make modifications for completion in this PR. Everything should be handled automatically for completion. Therefore, you just need to remove your completion changes and rebase on master. Thanks. |
|
@marckhouzam That's good news. I will do the same. |
Signed-off-by: Vibhav Bobade <[email protected]>
89e85da to
0c14df0
Compare
|
This is looking great! I want to make sure that passing an empty string ( Marking this for 3.2 for review |
|
I tried |
|
yes. Are you sure you're using a version of helm built using this PR? |
I build helm from source code of https://github.com/waveywaves/helm/tree/update/token |
… envvar Signed-off-by: Vibhav Bobade <[email protected]>
0c14df0 to
4bd3b8f
Compare
| s.configOnce.Do(func() { | ||
| s.config = kube.GetConfig(s.KubeConfig, s.KubeContext, s.namespace) | ||
| clientConfig := kube.GetConfig(s.KubeConfig, s.KubeContext, s.namespace) | ||
| if len(s.KubeToken) > 0 { |
There was a problem hiding this comment.
generally speaking, if s.KubeToken != "" is the more idiomatic approach. This looks good though, and we can address it in a follow-up PR.
|
thanks! |
|
I am unable to use server and token with helm cli it is giving error Same data if set in kubeconfig file, it is working. Am I missing some parameter here ? Please help |
|
Same issue with kkorada. I tried to use helm command in my local.
Is there necessary data do I have to add to use "--kube-apiserver" without "--kubeconfig"? |
|
Please open a new ticket. |
Signed-off-by: Vibhav Bobade [email protected]
fixes #7292