Open rendhalver opened 5 years ago
So, this turns out to have been fixed by https://github.com/abonas/kubeclient/pull/407.
Unfortunately, this just opens us up to another related issue: the second invocation of kubeclient in a restart, because it's using a new Kubeclient::Client
instance reading fresh from the KUBECONFIG file, and the previous refresh when verifying the namespace didn't update the config file, our refresh-token
is now invalid:
Note: id-tokens retrieved via this provider are not written back to the $KUBECONFIG file as they would be when using kubectl.
I think it's probably the responsibility of kubernetes-deploy
to write this back to the correct KUBECONFIG file, so this ticket constitutes that feature request.
Bug report
[Description of the bug] Running
kubernetes-restart
with an expired API token results in the command failing. I have not tested this with the other commands so I am not sure if it's exclusive to the restart command. Kubernetesid-token
's expire reasonably quickly (at least every few days). When kubectl is run with an expired token it will attempt to refresh it before contacting the api server. It definitely looks like kubernetes-restart and possibly other commands are not refreshing that token.I tested this buy checking my
~/.kube/config
file into git and running the restart. I think ran a kubectl command and diffed the kube config file and theid-token
andrefresh-token
were indeed different. After that update the restart command succeeded.Expected behavior: [What you expected to happen]
Restart is performed successfully.
Actual behavior: [What actually happened]
This was the output from a
kubernetes-restart
with an expired token.Version(s) affected: [run
kubernetes-deploy --version
] v0.25.0Steps to Reproduce