Skip to content

app-catalog: releases: Use the shared namespace filter - #1268

Open
Quent1L wants to merge 1 commit into
headlamp-k8s:mainfrom
Quent1L:feature/app-catalog-namespaces-filter
Open

Quent1L wants to merge 1 commit into
headlamp-k8s:mainfrom
Quent1L:feature/app-catalog-namespaces-filter

Conversation

@Quent1L

@Quent1L Quent1L commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The Installed view of the app-catalog plugin (Apps → Installed) used its own namespace filter: a bespoke single-select MUI Autocomplete backed by local component state. This made it inconsistent with the rest of Headlamp, where every list view shares one multi-select namespace filter.

Concretely, the old control:

  • looked and behaved differently from the standard namespace filter;
  • only allowed one namespace at a time, while Headlamp's is multi-select;
  • kept its state locally, so the selection was lost as soon as you navigated away, and was never shared with native views (Pods, Deployments, …) or with other plugins.

This PR replaces it with Headlamp's shared filter. SectionHeader becomes SectionFilterHeader, which appends the standard NamespacesAutocomplete. The selection now lives in the global filter.namespaces store, so it is multi-select, persisted per cluster in localStorage, mirrored into the ?namespace= query parameter, and preserved when moving between the Helm views and the rest of Headlamp.

Behaviour change

Namespace options now come from the cluster (Namespace.useList(), or allowedNamespaces from the cluster settings) instead of being derived from the loaded releases. That is the point of the change, but it means namespaces without releases appear in the dropdown, and listing namespaces requires the matching RBAC.

Steps to Test

  1. Build and install the plugin, then start Headlamp against a cluster that has Helm releases in at least two namespaces.
  2. Go to Apps → Installed. The namespace control is the standard multi-select chip autocomplete, identical to the one on Workloads → Pods.
  3. Select two namespaces. Only releases from those namespaces remain in the table, and the URL gains ?namespace=<ns1> <ns2>.
  4. Navigate to Workloads → Pods. The same two namespaces are still selected.
  5. Change the selection there, then go back to Apps → Installed. The new selection is applied.
  6. Reload the page while on Installed. The selection is restored from localStorage.
  7. Open …/apps/installed?namespace=<some-ns> directly in a fresh tab. That namespace is selected on first load.
  8. Clear the selection. All releases are shown again.
  9. Type in the Search field. It still debounces and combines with the namespace filter.
  10. Use the header checkbox. Select-all still only covers the currently visible (filtered) rows.

Replace the bespoke single-select namespace dropdown on the Installed
view with Headlamp's SectionFilterHeader, so the selection is the same
multi-select control used across the app and survives navigation between
Helm releases and native views. The store already persists it per cluster
and mirrors it into the ?namespace= query param.

Read filter.namespaces through react-redux rather than importing
useNamespaces from lib/redux/filterSlice: that path is not in the plugin
bundler's externals map and resolves to an undefined global at runtime.
This follows the existing metal3 and flux plugins.

Namespace options now come from the cluster instead of being derived from
the loaded releases, so listing namespaces requires the matching RBAC.

Signed-off-by: Quent1L <quentin-ol@ik.me>
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.

1 participant