Closed unmarshall closed 2 years ago
Ok it seems that the issue is with the kubectl commands. When you do kubectl config delete-context
then it does not change the correct context. The current-context continues to point to a context which has no entry under contexts in the kube config file which is a bit strange. If i now explicitly go into the kube config and then remove the value of current-context then it get properly reflected in PS1 so there is no issue with PS1. Apologies for creating an issue.
Closing this issue.
Hi,
Initially my kube-context had 2 contexts:
I deleted local-garden via
kubectl config delete-context local-garden
command. The context was removed from kubeconfig which is kept at its default location of~/.kube/config
. Shell used: zsh OS: macos, App: Terminal.appThere is no env
KUBECONFIG
set. Even after deleting the context the prompt continues to show:It seems that kube-ps1 is not reflecting the context properly. Even if you open a brand new terminal when zshrc is replayed the context still does not change.
It seems that the cache only updates the namespace and not the context. When it should actually be updating both.