feat: add more scripts
Some checks failed
CI / fmt (push) Failing after 2s
CI / check (push) Failing after 2s

This commit is contained in:
Nickolaj Jepsen 2026-01-22 23:12:42 +01:00
parent cd289da742
commit 575db8e773
7 changed files with 99 additions and 9 deletions

21
modules/scripts/kctx.bash Normal file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
if ! command -v kubectl &> /dev/null; then
echo "kubectl not found"
exit 1
fi
CONTEXTS=$(kubectl config get-contexts -o name)
if [ -z "$CONTEXTS" ]; then
echo "No kubernetes contexts found"
exit 1
fi
SELECTED=$(echo "$CONTEXTS" | fzf --prompt="Kube Context > " --height=20% --layout=reverse)
if [ -n "$SELECTED" ]; then
kubectl config use-context "$SELECTED"
echo "Switched to context: $SELECTED"
fi