Skip to content

Conversation

@augustin-pasq
Copy link

Hi!

This pull request fixes Flux resource fetching for users with limited cluster permissions.

When a user has access to only a few namespaces (but not all), Kubernetes resources - including Flux resources - are not displayed by default. Throughout Headlamp, such users must filter by the namespaces they are allowed to access in order to see data. However, for the Flux plugin, users previously had to manually configure Settings > Cluster > Allowed namespaces before being able to view them.

With this PR, that extra step is no longer necessary. The Flux plugin will now behave consistently with the rest of the app, providing a more seamless and homogeneous user experience.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the Flux plugin’s resource fetching behavior with the rest of Headlamp by honoring the currently selected namespaces from the global namespace filter, so users with limited namespace permissions no longer need to configure “Allowed namespaces” separately for Flux.

Changes:

  • Introduces a useNamespaces hook in the Flux helpers that reads the selected namespaces from the global Redux filter.namespaces state and exposes them as an array.
  • Updates all Flux list views (sources, notifications, kustomizations, image automation resources, and Helm releases) to pass the selected namespaces into their respective useList calls.
  • Wires the new hook into each affected list component via imports from ../helpers.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
flux/src/helpers/index.tsx Adds useNamespaces hook that selects filter.namespaces from Redux and memoizes it as an array, and imports useMemo/useSelector to support it.
flux/src/sources/SourceList.tsx Uses useNamespaces() to restrict Flux source listing (resourceClass.useList) to the currently selected namespaces.
flux/src/notifications/NotificationList.tsx Applies useNamespaces() to alert, provider, and receiver notification useList calls so they follow the namespace filter.
flux/src/kustomizations/KustomizationList.tsx Passes useNamespaces() into Kustomization.useList so kustomizations are fetched per selected namespaces.
flux/src/image-automation/ImageAutomationList.tsx Uses useNamespaces() for image update automations, policies, and repositories to scope their useList calls by namespace.
flux/src/helm-releases/HelmReleaseList.tsx Uses useNamespaces() to scope HelmRelease.useList to selected namespaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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