From 164881d1ec52a69093190302d481326c8909e4de Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sun, 17 Apr 2022 21:28:35 +0200 Subject: [PATCH] Add script and update ksc --- script/ksc | 9 +++++++++ zshrc | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 script/ksc diff --git a/script/ksc b/script/ksc new file mode 100755 index 0000000..6bd1624 --- /dev/null +++ b/script/ksc @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail + +context=$(kubectl config get-contexts -o name | fzf) +if [ $? -ne 0 ]; then + exit 0 +fi + +kubectl config use-context "$context" diff --git a/zshrc b/zshrc index 4a53d14..8e691df 100644 --- a/zshrc +++ b/zshrc @@ -79,7 +79,8 @@ alias gta="go test ./..." alias h="helm" alias ji="jira -b" alias k="kubectl" -alias ksc='kubectl config use-context $(kubectl config get-contexts -o name | fzf)' +alias kcc="kubectl config current-context" +alias kp="kubectl get pods -o wide" alias k9="kill -9" alias ll="exa -l --group-directories-first --git" alias ls="exa --color=auto"