Skip to content

'Cluster Settings' page is broken when switching between clusters #5062

@sniok

Description

@sniok

When using Cluster dropdown in the Cluster Settings page, settings values are incredibly broken, sometimes appearing, sometimes disappearing and overriding cluster settings with values from previously selected cluster

To Reproduce

Steps to reproduce the bug:

  1. Have at least two clusters in headlamp
  2. Go to Cluster Settings page
  3. Go to cluster1 and set a setting like allowed namespace
  4. Switch to cluster2
  5. Switch back to cluster1
  6. Repeat steps 4,5
  7. Observe that the allowed namespace value sometimes is missing from cluster1, sometimes appears in cluster2
  8. Observe the localStorage values in the DevTools when you switch between clusters using the dropdown. Cluster Settings values in local storage are updated when just switching between clusters. This shouldn't cause any writes or updates!

Demo

Video where I change allowed namespace in one cluster and then just toggle between two clusters

cluster-settings-broken.mp4

Are you able to fix this issue?

yeah

notes

This is caused by duplicated state, lack of single source of truth, broken rules of hooks (we should REALLY enable those eslint rules) and ad-hoc syncing with localStorage. The page really needs a refactor.

Metadata

Metadata

Assignees

Labels

frontendIssues related to the frontendkind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions