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