headlamp icon indicating copy to clipboard operation
headlamp copied to clipboard

Resort to showing the default namespace when namespaces fail to be listed

Open joaquimrocha opened this issue 1 year ago • 2 comments

A couple of users have reported now what they think is an auth issue in Headlamp, since it reports as having "no permissions" when listing resources while other solutions like kubectl work fine.

In a recent Slack conversation, it's become (almost) clear that this has to do with the fact that Headlamp tries to list all namespaces while those other tools use the kubeconfig's declared default namespace. In that conversation, the reporter has shared a terraform config to initialize a cluster and reproduce this.

IMO, a way to fix this would be to still attempt to list resources from all namespaces, and in case of failure resort to showing the default namespace (if specified). We could also that default namespace by default immediately, but I do like to have the global view that all namespaces give us as a default view.

Acceptance Criteria:

  • [x] Pass the default namespace together with the cluster info (from kubeconfig)
  • [ ] Resort to selecting the default namespace if listing all namespaces fails
  • [ ] Remember the namespaces selected when loading Headlamp (i.e. store this setting in the session storage)

joaquimrocha avatar Nov 02 '23 14:11 joaquimrocha

So I have been working on something to at least warn the users they should check their allowed namespaces if they are getting permissions issues. Here is a preview:

Screenshot showing a warning + a message about checking the allowed namespaces

But it's too risky for tomorrow's release, so let's leave it for the next one.

joaquimrocha avatar May 28 '24 22:05 joaquimrocha

No one got to this one yet, so moving it to the next release milestone.

illume avatar Jul 25 '24 08:07 illume