From 5b8c89bfce6ea533513bb15a1724bf2985634946 Mon Sep 17 00:00:00 2001 From: Michael Skrynski Date: Thu, 12 Sep 2019 23:25:54 +0200 Subject: [PATCH] adding kubernetes stuff --- fish/config.fish | 1 + fish/functions/fish_prompt.fish | 5 ++++- fish/functions/ks.fish | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 fish/functions/ks.fish diff --git a/fish/config.fish b/fish/config.fish index f4f2594..0488376 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -67,3 +67,4 @@ set -g fish_user_paths "/usr/local/sbin" $fish_user_paths # add kitty support # kitty + complete setup fish | source +# set -g fish_user_paths "/usr/local/opt/postgresql@9.5/bin" $fish_user_paths diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish index 99f9365..8f043aa 100644 --- a/fish/functions/fish_prompt.fish +++ b/fish/functions/fish_prompt.fish @@ -11,7 +11,10 @@ function _rb_prompt end function _kb_context - echo (kubectl config current-context | awk '{print $1}') + kubectl config current-context 2> /dev/null + if [ (test $status -eq 0) ] + echo (kubectl config current-context | awk '{print $1}') + end end function fish_prompt diff --git a/fish/functions/ks.fish b/fish/functions/ks.fish new file mode 100644 index 0000000..0343526 --- /dev/null +++ b/fish/functions/ks.fish @@ -0,0 +1,3 @@ +function ks --description 'show cluster status for dev, int or prod' + az aks show --resource-group $argv --name aks-$argv --output table +end