Files
_dotfiles/.config/i3blocks/kubernetes/kubernetes
2024-06-12 13:49:42 +02:00

11 lines
367 B
Bash
Executable File

#!/usr/bin/env bash
KCONTEXT=$(kubectl config current-context 2>/dev/null)
if [[ $?=="0" ]]; then
CC=$(kubectl config view -ojsonpath='{..current-context}')
KNAMESPACE=$(kubectl config view -ojsonpath="{.Contexts[?(@.Name==\"$CC\")]..namespace}")
echo "$KCONTEXT/$KNAMESPACE"
echo "$KCONTEXT/$KNAMESPACE"
echo \#4040FF # color
fi