mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-07-07 12:28:43 +00:00
make kubectx consistent with kubens wrt. KUBECTL environment variable (#274)
This commit is contained in:
parent
8241576f28
commit
9527e308e5
16
kubectx
16
kubectx
@ -192,13 +192,15 @@ unset_context() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if hash kubectl 2>/dev/null; then
|
if [[ -z "${KUBECTL:-}" ]]; then
|
||||||
KUBECTL=kubectl
|
if hash kubectl 2>/dev/null; then
|
||||||
elif hash kubectl.exe 2>/dev/null; then
|
KUBECTL=kubectl
|
||||||
KUBECTL=kubectl.exe
|
elif hash kubectl.exe 2>/dev/null; then
|
||||||
else
|
KUBECTL=kubectl.exe
|
||||||
echo >&2 "kubectl is not installed"
|
else
|
||||||
exit 1
|
echo >&2 "kubectl is not installed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$#" -eq 0 ]]; then
|
if [[ "$#" -eq 0 ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user