This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/common/bin/kubfn

13 lines
244 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env sh
has_command kubectl || {
echo "kubectl command not found"
exit 1
}
kubectl get namespaces --show-labels | \
uniq | \
sort | \
cut -d ' ' -f1 | \
fzf | \
xargs -I{} kubectl config set-context --current --namespace='{}'