Auth after switch, to populate some missing vars

This commit is contained in:
Daniel Berteaud 2023-11-03 13:04:39 +01:00
parent 4dcff9274a
commit 4bda44903c
1 changed files with 3 additions and 1 deletions

4
ctctl
View File

@ -76,7 +76,7 @@ ctctl_switch_env(){
set +o allexport
fi
# Authenticate
# Authenticate so we can list Nomad's namespaces
ctctl_auth_env
if [ -z "${TARGET_NAMESPACE}" ]; then
@ -925,9 +925,11 @@ case $1 in
switch)
shift
ctctl_switch_env "$@"
ctctl_auth_env
;;
*)
ctctl_switch_env "$@"
ctctl_auth_env
;;
esac