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>
|
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. |
|
Hi @sudermanjr @transient1 — friendly ping! This PR has been open for 4 days. The unit tests and lint are passing on CircleCI. The Would love to get a review when you have a moment. Happy to make any adjustments! |
|
Thanks for the PR! Sorry for the slow uptake on our end. This particular set of issues is not currently covered by any of the tests, so it will need to be verified manually, or tests will need to be added to cover it. Can you either add some tests, or provide some screenshots of the desired behavior for each of the three scenarios? |
Thanks for taking a look, @sudermanjr! OnByDefault=true → namespaces discovered from Goldilocks-created VPAs I’ll also make sure the tests cover the expected filtering and alphabetical sorting of the returned namespaces. |
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