dashboard: fix /namespaces page empty when on-by-default is set#861
Open
BRGOVIND wants to merge 1 commit into
Open
dashboard: fix /namespaces page empty when on-by-default is set#861BRGOVIND wants to merge 1 commit into
BRGOVIND wants to merge 1 commit into
Conversation
When the Goldilocks controller runs with --on-by-default, it creates VPA objects for namespaces that have no goldilocks.fairwinds.com/enabled label. The /namespaces dashboard page uses label-based namespace discovery, so it returns nothing and shows "No namespaces are labelled" even though the controller is actively managing those namespaces. The /dashboard page works correctly in this scenario because it discovers namespaces from VPA objects directly (via summary.GetSummary), not from namespace labels. Fix: when OnByDefault or ShowAllVPAs is set, derive the namespace list from VPA objects using the same VpaLabels filter that the /dashboard page uses. This makes both pages consistent and removes the requirement to also set --on-by-default on the dashboard when it is set on the controller. - OnByDefault=true: lists VPAs with Goldilocks labels (creator=Fairwinds, source=goldilocks), extracts unique namespaces sorted alphabetically. - ShowAllVPAs=true: lists all VPAs without label filter. - Default: unchanged, queries namespace label goldilocks.fairwinds.com/enabled=true. Also update the empty-state message in namespace_list.gohtml to give accurate guidance for both modes. Fixes FairwindsOps#855 Signed-off-by: B R GOVIND <brgovind2005@gmail.com>
Author
|
The ci/circleci: test status check (lint + unit tests) is passing. The ests workflow check failure appears to be the Happy to rebase or adjust anything if needed for review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #855 — /namespaces dashboard page shows empty when --on-by-default is set on the controller.
Root cause
The /namespaces page and /dashboard page use different namespace discovery strategies:
When the controller runs with --on-by-default, it creates VPA objects for unlabelled namespaces. The /dashboard page works because it finds those VPAs. The /namespaces page fails because it looks for the label, which is absent.
Fix
When OnByDefault or ShowAllVPAs is set on the dashboard, switch /namespaces to use VPA-based discovery (the same source as /dashboard), making both pages consistent.
Namespaces are returned sorted alphabetically.
The empty-state message in
amespace_list.gohtml is also updated so it gives accurate guidance for each mode instead of always suggesting kubectl label ns ....
Changes