HELM_PLUGINS is not honored by the http and local plugin installers
What happened?
When HELM_PLUGINS is set, helm plugin install behaves differently depending on the installer type.
Plugins installed via VCS (e.g. https://github.com/databus23/helm-diff) or OCI end up in $HELM_PLUGINS, as expected. Plugins installed via http (e.g. https://github.com/jkroepke/helm-secrets/releases/download/v4.7.5/secrets-4.7.5.tgz) or from a local path / archive still end up in the default plugins directory, aka. data
path + "plugins" (~/.local/share/helm/plugins on linux).
The culprit is Path() in internal/plugin/installer/http_installer.go and local_installer.go, which still use helmpath.DataPath("plugins", ...) instead of cli.EnvSettings.PluginsDirectory like the oci installer does.
Side note, probably deserving its own treatment : the http, local and oci installers also save the tarball (and .prov) copy used for verification under helmpath.DataPath("plugins", ...), regardless of HELM_PLUGINS.
Fix proposal in #31756.
What did you expect to happen?
All installers honor HELM_PLUGINS, whatever the plugin source :)
How can we reproduce it (as minimally and precisely as possible)?
$ export HELM_PLUGINS=/tmp/helm-plugins
$ helm plugin install https://github.com/databus23/helm-diff
$ helm plugin install https://github.com/jkroepke/helm-secrets/releases/download/v4.7.5/secrets-4.7.5.tgz
$ ls $HELM_PLUGINS
helm-diff
$ ls ~/.local/share/helm/plugins
secretshelm-diff (vcs) is where it should be, secrets (http) is not. Same story with helm plugin install ./some-local-plugin-dir or a local .tgz.
Helm version
$ helm version
# 4.2.4Also reproduced on current main (bfa3b6c32).
Kubernetes version
Not relevant, this is client side only.
$ kubectl version
# 1.36.1Source: helm/helm