nix/modules/home-manager/scripts/common/bin/kubfn

13 lines
243 B
Plaintext
Raw Normal View History

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