This commit is contained in:
Jordi Prats 2025-01-23 12:07:06 -05:00 committed by GitHub
commit 8992b10336
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,7 +108,11 @@ save_context() {
}
switch_context() {
$KUBECTL config use-context "${1}"
if [ "$(get_contexts | grep -c "${1}")" -eq 1 ]; then
$KUBECTL config use-context "$(get_contexts | grep "${1}")"
else
$KUBECTL config use-context "${1}"
fi
}
choose_context_interactive() {