mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-09-06 11:00:20 +00:00
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>
12 lines
252 B
Bash
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}'
|
|
}
|