Repository navigation
fix(plugin): register CLI command for legacy plugins that also declare downloaders - #32743
Open
ruslan-shaydullin wants to merge 1 commit into
Open
ruslan-shaydullin wants to merge 1 commit into
ruslan-shaydullin wants to merge 1 commit into
Conversation
This was referenced Oct 13, 2026
…e downloaders A legacy plugin.yaml with a command and downloaders is converted to a getter/v1 plugin, and loadCLIPlugins only loads cli/v1 plugins, so the plugin's "helm <name>" command is missing in Helm 4. Helm 3 had both. Keep the getter/v1 type and attach a CLI config built from usage, description and ignoreFlags. loadCLIPlugins registers cli/v1 plugins first, then these legacy plugins, and skips a legacy command whose name is already taken. Refs helm#31500 Signed-off-by: Ruslan Shaydullin <[email protected]>
ruslan-shaydullin
force-pushed
the
fix/legacy-plugin-downloader-cli
branch
from
October 14, 2026 15:26
2eb3a88 to
57c4328
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The compatibility fix is narrowly scoped, preserves getter behavior, handles conflicts safely, and has adequate automated coverage.
0 open findings
What changed in this PR
Restores Helm 3-compatible CLI command registration for legacy plugins that also provide downloaders.
Changes:
- Preserves generated CLI configuration for legacy getter plugins.
- Loads eligible legacy plugins as CLI commands while safely handling name conflicts.
- Adds command loading, completion, conflict, and metadata tests.
| File | Description |
|---|---|
internal/plugin/metadata.go |
Generates and exposes legacy CLI configuration. |
internal/plugin/metadata_test.go |
Verifies downloader-only plugins remain non-CLI. |
internal/plugin/loader_test.go |
Verifies legacy mixed plugin conversion. |
pkg/cmd/load_plugins.go |
Registers legacy commands with CLI-first conflict precedence. |
pkg/cmd/plugin_test.go |
Tests loading, execution, completion, and conflicts. |
pkg/cmd/testdata/legacy-conflict/echo/plugin.yaml |
Adds conflict fixture. |
pkg/cmd/testdata/helmhome/helm/plugins/downloader/plugin.yaml |
Adds mixed legacy plugin fixture. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
@gjenkins8 could you take a look when you have time? It's the Helm 4 regression from #31500, where legacy plugins that declare downloaders lose their |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
A legacy plugin (no
apiVersion) that has both a command anddownloadersloses its command in Helm 4.fromMetadataLegacyconverts it to agetter/v1plugin, andloadCLIPluginsonly loadscli/v1plugins. helm-s3 and helm-secrets are built this way, sos3://andsecrets://still work, buthelm s3andhelm secretsdon't.The plugin keeps the
getter/v1type, sohelm plugin list,--typeand the getter path are unchanged. The legacy conversion now also builds a CLI config fromusage,descriptionandignoreFlags, andloadCLIPluginsregisters a command from it. This is how Helm 3 behaved, and the plugin docs say legacy plugins will still be supported throughout the life of Helm 4. Similar to #31613.refs #31500. This covers legacy plugins only, not multi-type v1 plugins.
Special notes for your reviewer:
A legacy plugin with downloaders but no command still gets no command, since there is nothing to run.
cli/v1 plugins are registered first, so nothing changes for them. If the name of a legacy plugin is already taken by a built-in or another plugin, it stays a getter and loading continues (logged at debug level). For example, helm-push before v0.10 is named
push, which is a built-in. Without the skip, the existing conflict check would stop loading every plugin after it.The new field on
Metadatais unexported and read through aCLIConfig()method, becauseSignPluginmarshalsMetadatainto the.provfile.The docs already describe this behaviour, so I don't think a docs change is needed.
Tests: a new
TestLoadDircase for the existingdownloaderfixture, a legacy fixture inpkg/cmd/testdata/helmhome(one more row inTestLoadCLIPluginsand in the completion table), and a name conflict test with two plugin dirs. I also checked by hand with helm-s3 0.17.2 against MinIO and helm-secrets 4.6.11 with sops/age: both commands work,s3://andsecrets://still work, andhelm plugin listoutput is the same as before.If applicable:
docs neededlabel should be applied if so)