nix/scripts/bin/kubfc
2023-09-05 15:15:43 -05:00

10 lines
206 B
Bash
Executable file

#!/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 '{}'