Files
kubectx/utils.bash
Ahmet Alp Balkan d441505348 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>
2017-05-16 19:06:58 -07:00

12 lines
252 B
Bash

current_context() {
kubectl config view -o=jsonpath='{.current-context}'
}
get_contexts() {
kubectl config get-contexts -o=name | sort -n
}
get_namespaces() {
kubectl get namespaces -o=jsonpath='{range .items[*].metadata.name}{@}{"\n"}{end}'
}