mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-09-25 06:43:32 +00:00
Add kubens tool for namespace switching
Fixes #1. Now kubectx also ships with kubens. Extracted utility functions to a utils.bash file, loaded from ../include/utils.bash. Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
8
completion/kubens.bash
Normal file
8
completion/kubens.bash
Normal file
@@ -0,0 +1,8 @@
|
||||
_kube_namespaces()
|
||||
{
|
||||
local curr_arg;
|
||||
curr_arg=${COMP_WORDS[COMP_CWORD]}
|
||||
COMPREPLY=( $(compgen -W "- $(kubectl get namespaces -o=jsonpath='{range .items[*].metadata.name}{@}{"\n"}{end}')" -- $curr_arg ) );
|
||||
}
|
||||
|
||||
complete -F _kube_namespaces kubens
|
Reference in New Issue
Block a user