kubernetes-sigs / krew

📦 Find and install kubectl plugins
https://krew.sigs.k8s.io
Apache License 2.0
6.37k stars 369 forks source link

Path setting with ~ is not correctly interpreted #720

Closed tillig closed 3 years ago

tillig commented 3 years ago

After installing krew, I've added ~/.krew/bin to my path, which works for other tools requiring home-directory-based-paths... but does not seem to work for kubectl or krew.

For krew, you get a warning when you do an update:

WARNING: To be able to run kubectl plugins, you need to add
the following to your ~/.bash_profile, ~/.bashrc, or ~/.zshrc:

    export PATH="${PATH}:${HOME}/.krew/bin"

and restart your shell.

However, I can do kubectl krew list and see the plugins I have, so some things work, just not all.

I do see that kubectl itself doesn't seem to handle ~ based paths with respect to plugins so I've added a related issue there. Likely that will have to be handled first.

ahmetb commented 3 years ago

I left my comment at https://github.com/kubernetes/kubectl/issues/1125#issuecomment-942551895 I don't think this is something krew or kubectl should handle.

Ideally ~ should go away by the time the export command (or variable assignment) is evaluated in your shell. Make sure you are not using \~ (or single quotes, like export PATH='...').

/close

k8s-ci-robot commented 3 years ago

@ahmetb: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/krew/issues/720#issuecomment-942553376): >I left my comment at https://github.com/kubernetes/kubectl/issues/1125#issuecomment-942551895 >I don't think this is something krew or kubectl should handle. > >Ideally `~` should go away by the time the `export` command (or variable assignment) is evaluated in your shell. Make sure you are not using `\~` (or single quotes, like `export PATH='...'`). > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.