Skip to content
Permalink
Browse files

Adding dependency checker for kubectx and kubens (#92)

Ensure kubectl in PATH for kubectx and kubens.
  • Loading branch information...
ahmetb committed Oct 22, 2018
2 parents 244dd5b + 083e56f commit 517dae9fc887f13ba20aa7f513fe5a0c27b86d8c
Showing with 8 additions and 0 deletions.
  1. +4 −0 kubectx
  2. +4 −0 kubens
@@ -159,6 +159,10 @@ delete_context() {
}

main() {
if ! hash kubectl 2>/dev/null; then
echo >&2 "kubectl is not installed"
exit 1
fi
if [[ "$#" -eq 0 ]]; then
if [[ -t 1 && -z "${KUBECTX_IGNORE_FZF:-}" && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then
choose_context_interactive
4 kubens
@@ -156,6 +156,10 @@ swap_namespace() {
}

main() {
if ! hash kubectl 2>/dev/null; then
echo >&2 "kubectl is not installed"
exit 1
fi
if [[ "$#" -eq 0 ]]; then
if [[ -t 1 && -z ${KUBECTX_IGNORE_FZF:-} && "$(type fzf &>/dev/null; echo $?)" -eq 0 ]]; then
choose_namespace_interactive

0 comments on commit 517dae9

Please sign in to comment.
You can’t perform that action at this time.