Added lookup for MC if no args given to gs-login

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2021-12-14 07:49:42 +00:00
parent 586538f14f
commit 3024bbd0cc
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78

View File

@ -55,6 +55,10 @@ while test $# -gt 0; do
done
case ${#POS_ARGS[@]} in
0)
INST=$(opsctl list installations --short | tr ' ' '\n' | fzf)
kubectl gs login --kubeconfig=${KUBECONFIG} ${INST} ${DEBUG} 2>/dev/null || opsctl kgs login -i ${INST} || opsctl create kubeconfig ${INST}
;;
1)
kubectl gs login --kubeconfig=${KUBECONFIG} ${POS_ARGS[0]} ${DEBUG} 2>/dev/null || opsctl kgs login -i ${POS_ARGS[0]} || opsctl create kubeconfig ${POS_ARGS[0]}
;;