Last active
February 11, 2020 08:57
-
-
Save Eun/65a916fc71e7bee48c87a2e443e11b12 to your computer and use it in GitHub Desktop.
Revisions
-
Eun revised this gist
Feb 11, 2020 . 1 changed file with 11 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,13 @@ # completion for kubesh # (put in ~/.config/fish/completions) function __kubesh_completion if test -n "$__kubesh_completion_cache_valid_until"; and test $__kubesh_completion_cache_valid_until -gt (date --utc +"%s") string join \n $__kubesh_completion_cache_content return end set -g __kubesh_completion_cache_valid_until (math (date --utc +"%s") + 10) set -g __kubesh_completion_cache_content (kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}') string join \n $__kubesh_completion_cache_content end complete -f -c kubesh -a '(__kubesh_completion)' -
Eun created this gist
Feb 28, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ #!/bin/bash if [ ${#@} -lt 1 ]; then echo "usage: kubesh <pod> [shell]" exit 1 fi SHELL="sh" if [ ${#@} -gt 1 ]; then SHELL=${@:2} fi kubectl exec -ti ${1} ${SHELL} This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # completion for kubesh # (put in ~/.config/fish/completions) complete -f -c kubesh -a '(kubectl get pods -o=jsonpath=\'{range .items[*]}{.metadata.name}{"\n"}{end}\')'