fix(getter): find getter plugins in every HELM_PLUGINS directory by SkippySteve · Pull Request #32779 · helm/helm · GitHub
Skip to content

fix(getter): find getter plugins in every HELM_PLUGINS directory - #32779

Open
SkippySteve wants to merge 1 commit into
helm:mainfrom
SkippySteve:fix/getter-plugins-dir-list
Open

SkippySteve wants to merge 1 commit into
helm:mainfrom
SkippySteve:fix/getter-plugins-dir-list

Conversation

@SkippySteve

Copy link
Copy Markdown

What this PR does / why we need it:

HELM_PLUGINS can list several directories separated by the OS path-list separator. Post-renderer lookup (filepath.SplitList in pkg/postrenderer) and helm plugin list handle that, but collectGetterPlugins passes the whole string to plugin.FindPlugins as one directory:

plgs, err := plugin.FindPlugins([]string{settings.PluginsDirectory}, d)

With more than one entry no getter plugin is found, so every plugin-backed scheme fails (helm pull s3://…, git+https://…, etc.), even though helm plugin list shows the plugin. Helm 3 split the list here (FindPlugins iterated filepath.SplitList(plugdirs)), so this is a v4 regression. The fix is filepath.SplitList(settings.PluginsDirectory).

The same file also had fmt.Errorf("plugin %q failed to invoke: %w", g.plg, err), which formats the entire plugin struct. It now uses g.plg.Metadata().Name.

Special notes for your reviewer:

End to end, with helm built from main and from this branch. A getter/v1 subprocess plugin for gettest:// sits in the second of two HELM_PLUGINS entries:

$ HELM_PLUGINS=/tmp/x/empty:/tmp/x/plugins helm pull gettest://charts/demo-0.1.0.tgz
main:         Error: scheme "gettest" not supported
this branch:  (downloads demo-0.1.0.tgz)

When the getter exits non-zero:

main:         Error: plugin &{{"v1" "gettest" "getter/v1" "subprocess" "0.1.0" "" %!q(*schema.ConfigGetterV1=&{[gettest]}) %!q(*plugin.RuntimeConfigSubprocess=…
this branch:  Error: plugin "gettest" failed to invoke: plugin "gettest" exited with error

#32666 rewrites the same FindPlugins line (to envVars["HELM_PLUGINS"]) and also passes a single directory. Whichever lands second only needs filepath.SplitList(...) around it.

If applicable:

  • this PR contains user facing changes (the docs needed label should be applied if so)
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

Tests: TestCollectPluginsMultiplePluginDirs (on main: "[]" should have 2 item(s), but has 0) and TestGetterPluginInvokeErrorNamesPlugin (on main: the struct dump above) both pass with the change. A single-directory HELM_PLUGINS behaves exactly as before. go test ./pkg/getter/, go vet and golangci-lint v2.14.0 are clean on Go 1.26.

HELM_PLUGINS may hold a list of directories (like PATH), and plugin
discovery for post-renderers and `helm plugin list` splits it, but
collectGetterPlugins passed the whole string as a single directory. With
more than one entry no getter plugin was found and downloads failed with
`scheme "x" not supported`. Helm 3 split the list here too.

Also name the plugin in the getter invoke error instead of formatting
the whole plugin struct with %q.

Signed-off-by: Steven Richards <steve@aimingupward.com>
@pull-request-size pull-request-size Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 19, 2026
@github-actions github-actions Bot added the v4.x Issues and Pull Requests related to the major version v4 label Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files. v4.x Issues and Pull Requests related to the major version v4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant