Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding dependency checker for kubectx and kubens #92
Let me know what you think!
Hello, thanks for your PR.
How are you installing kubectx (on which platform/package manager)? For macOS, our Homebrew package has a dependency on kubectl, so that'll be installed automatically.
In other platforms (like Linux) I'm not sure how realistic is it to expect that people will have kubectx; but not kubectl.
This PR isn't addressing that issue. That issue is happening because bash is not using
As far as your PR is concerned, you can simply do this (and I prefer this):
if ! hash kubectl 2>/dev/null; then echo >&2 "kubectl is not installed' exit 1 fi
@ahmetb Im just clone the repo and running the scripts from the repository. Considering this is a
My fault, I miss understood the requirements for #5.
Thank for the feedback and Ill fixup the PR with your suggestions.
@sarcasticadmin The code looks good but I'm still not sure if anyone is actually trying to use kubectx without kubectl. :)
The issue #5 as I said is because we lose the exit code of the function while we call it from a for-loop in bash script, so
@ahmetb sorry I was under the impression that you were still interested in adding a check for the existence of
If its still something you think isnt necessary you can close this one. I'll follow up with a fix for #5 in a different PR