Helm Releases uses --all-namespaces despite namespace selection, breaking namespace-scoped RBAC
Describe the bug
The Helm Releases panel calls helm with no namespace scope set even when a specific namespace is selected in the namespace dropdown, if that selection happens to cover all namespaces the current user can access. This breaks Helm Releases for users whose RBAC only grants namespace-scoped access to secrets (via a RoleBinding, not a ClusterRoleBinding) -- a normal setup in multi-tenant clusters -- because helm ls --all-namespaces requires cluster-scoped access.
I also confirmed the trigger condition: if you add an extra, non-existent namespace to the selection so it no longer exactly equals "all namespaces accessible to the user", the panel correctly scopes the call to the real namespace(s) and works fine. This suggests the namespace-selection logic collapses "every accessible namespace is selected" into an implicit "all namespaces" mode instead of only doing that on an explicit "select all" action.
To Reproduce
- Connect to a cluster with a kubeconfig that only has access to one namespace (e.g.
foo), granted via a namespace-scoped RoleBinding (no ClusterRoleBinding, no cluster-scopedsecretsaccess). - In Lens, select
fooin the namespace dropdown (the only namespace available). - Go to Helm -> Releases.
- See error (below).
- As a workaround, manually add a second, arbitrary/non-existent/inaccessible namespace to the selected-namespaces list. Reload Helm -> Releases and select your original namespace -- it now works.
Expected behavior
Selecting a namespace (or set of namespaces) should always scope the Helm ls call to exactly those namespaces via --namespace, and never fall back to --all-namespaces, regardless of whether the selection happens to match every namespace the user can see.
Screenshots An error notification appears on the top right:
Command failed:
C:\Users\<my-user>\AppData\Local\Programs\Lens\resources\x64\helm.exe ls --all --max 9999 --output json --all-namespaces --kubeconfig C:\Users\<my-user>\AppData\Local\Temp\kubeconfig-direct-ecbc1838276e9e679d9cfd3b37e44500 Error: list: failed to list: secrets is forbidden: User "system:serviceaccount:tenants:<my-namespace>" cannot list resource "secrets" in API group "" at the cluster scopeEnvironment (please complete the following information):
- Lens Version: Lens: 2026.9.20601-latest Electron: 43.4.0 Chrome: 150.0.7871.224 Node: 24.18.1
- OS: Windows 11
- Installation method (e.g. snap or AppImage in Linux): https://api.k8slens.dev/binaries/Lens%20Setup%202026.9.20601-latest.exe
Logs:
When there are other namespaces (that I don't have access to) manually configured except the my-namespace:
2026-09-08T16:57:33.643Z debug: [CLUSTER]: listing helm releases for clusterId=my-cluster { namespace: 'my-namespace' }When only my-namespace is configured:
2026-09-08T16:58:31.012Z debug: [CLUSTER]: listing helm releases for clusterId=my-cluster { namespace: undefined }When no namespaces are manually configured:
2026-09-08T17:02:08.187Z debug: [CLUSTER]: listing helm releases for clusterId=my-cluster { namespace: undefined }Kubeconfig:
apiVersion: v1
kind: Config
clusters:
- name: "my-cluster"
cluster:
certificate-authority-data: <my-certificate-authority-data>
server: "<my-server>"
contexts:
- name: "my-namespace-my-cluster"
context:
cluster: "my-cluster"
namespace: "my-namespace"
user: "my-namespace"
users:
- name: "my-namespace"
user:
token: <my-token>
current-context: "my-namespace-my-cluster"
Additional context The same kubeconfig and namespace selection work correctly in Freelens/Openlens, which do not appear to collapse a single/full namespace selection into an implicit all-namespaces call.
Source: lensapp/lens