Skip to content

Helm 4 compatibility#762

Open
tsacha wants to merge 4 commits intoRamilito:mainfrom
tsacha:helm-4-compatibility
Open

Helm 4 compatibility#762
tsacha wants to merge 4 commits intoRamilito:mainfrom
tsacha:helm-4-compatibility

Conversation

@tsacha
Copy link
Copy Markdown

@tsacha tsacha commented Mar 29, 2026

Summary

  • helm list: drop the -a flag removed in Helm 4
  • helm status: drop --show-desc, removed in helm/helm#13444; default status output still includes the release description.
  • helm get manifest: pass -n <namespace> so the correct release is used when the same name exists in several namespaces.

Details

This PR adds Helm v4 compatibility and fixes a Lua error triggered when fetching releases:

Error executing vim.schedule lua callback: ...y/kubectl.nvim/lua/kubectl/resources/helm/definition.lua:10: bad argument #1 to 'ipairs' (table expected, got string)
stack traceback:
        [C]: in function 'ipairs'
        ...y/kubectl.nvim/lua/kubectl/resources/helm/definition.lua:10: in function 'processFunc'
        .../nvim/lazy/kubectl.nvim/lua/kubectl/resource_factory.lua:76: in function 'process'
        ...im/lazy/kubectl.nvim/lua/kubectl/resources/helm/init.lua:69: in function <...im/lazy/kubectl.nvim/lua/kubectl/resources/helm/init.lua:68>

Helm v4 deleted -a / --all flag from the list command:

$ helm version
version.BuildInfo{Version:"v4.1.3", GitCommit:"c94d381b03be117e7e57908edbf642104e00eb8f", GitTreeState:"", GoVersion:"go1.26.1-X:nodwarf5", KubeClientVersion:"v1.35"}
$ helm ls -a -A --output json
Error: unknown shorthand flag: 'a' in -a

An upstream PR (helm/helm#31828) aims to reintroduce it for backward compatibility, but it hasn't been merged yet.

Note on breaking changes:

This update changes how kubectl.nvim behaves with Helm v3: superseded, uninstalled, pending-install, and pending-upgrade releases will no longer be displayed in the list.

To maintain the previous behavior across both versions, we could use explicit flags: --pending --deployed --failed --superseded --uninstalled --uninstalling. Let me know if you'd like me to update the PR to maintain full backward compatibility.

@Ramilito
Copy link
Copy Markdown
Owner

Ramilito commented Apr 2, 2026

Hey! Awesome work!

I do want to stay backwards compatible with v3 somehow.
I suggest we do it in a simple manner by just adding a helm configuration option, what do you think? Alternatively we could dynamically figure out the version and store it when going to the helm view.

@tsacha
Copy link
Copy Markdown
Author

tsacha commented Apr 6, 2026

There you go. I tried the second solution with a sync shell command. The version is cached in M.version after the first call, so helm version is only executed once per session.

ft = "k8s_yaml",
syntax = "yaml",
args = { "get", "manifest", name },
args = { "get", "manifest", name, "-n", ns },
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want the namespace here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants