asdf-vm / asdf

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
https://asdf-vm.com/
MIT License
21.83k stars 775 forks source link

bug: Interdependence between plugins? #1127

Open kronn opened 2 years ago

kronn commented 2 years ago

Describe the Bug

> kubectl
No preset version installed for command kubectl
Please install a version by running one of the following:

asdf install oc 3.11.117

or add one of the following versions in your config file at /PATH/TO/REPO/.tool-versions
oc 4.8.0

> asdf install oc 3.11.117
oc 3.11.117 is already installed

Steps to Reproduce

I noticed that the calling kubectl (directly or indirectly through kubectx) broke after I installed oc 4.8.0. Uninstalling oc 4.8 fixes the issue.

I am however quite un-confident that this is the trigger. kubectl does not have any versions installed through asdf. There is only one version of it in the path that is too old (but needed) to be installable through asdf-kubectl.

Expected Behaviour

Plugins without installed version should not break things

Actual Behaviour

see above "Describe the bug"

Environment

OS:
Linux $USER-$COMPANY 5.8.0-63-generic #71~20.04.1-Ubuntu SMP Thu Jul 15 17:46:08 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ASDF VERSION:
v0.8.1-a1ef92a

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=$HOME/.asdf

ASDF INSTALLED PLUGINS:
elixir                       https://github.com/asdf-vm/asdf-elixir.git
erlang                       https://github.com/asdf-vm/asdf-erlang.git
golang                       https://github.com/kennyp/asdf-golang.git
kubectl                      https://github.com/Banno/asdf-kubectl.git
kubectx                      https://gitlab.com/wt0f/asdf-kubectx.git
kubeval                      https://github.com/stefansedich/asdf-kubeval.git
kustomize                    https://github.com/Banno/asdf-kustomize.git
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git
oc                           https://github.com/sqtran/asdf-oc.git
ruby                         https://github.com/asdf-vm/asdf-ruby.git
yarn                         https://github.com/twuni/asdf-yarn.git

asdf plugins affected (if relevant)

kubectl, kubectx, oc

OR maybe none of the above.

jthegedus commented 2 years ago

Related to #804 & #196

kronn commented 2 years ago

Interesting, I wasn't aware that the order matters (though it does make sense and is certainly preferable to full-blown dependency-mangement...).

I will try to change the order in my global .tool-versions and see if the error persists.

kronn commented 2 years ago

Well, I have stopped using the kubectl-plugin which removes all the shim-magic and therefore my problem. Turns out that I currently only need one version of kubectl, which I can "manage" by putting it into my PATH.

I could not resolve the problem by ordering the entries in the .tool-versions, but this may be my error, as I did not spent a lot of time to test thoroughly. A quick test did not resolve it and I realised I do not have any version of kubectl aside from my system-version installed.

Should this ticket stay here open as a reminder?