nix/home/scripts/common/bin/kubfc

10 lines
206 B
Plaintext
Raw Normal View History

2023-09-05 13:52:52 -05:00
#!/usr/bin/env sh
kubectl config get-contexts --no-headers | \
uniq | \
sort | \
tr -s ' ' | \
sed -E 's/^\*?[[:space:]]*//g' | \
cut -d ' ' -f1 | \
sk | \
xargs -I{} kubectl config use-context '{}'