feat: remove kubernetes-dashboard addon (CK 1.36) - #239
Conversation
Test Report — PR #239: Remove kubernetes-dashboard addonTested: Test details### ✅ Test 1 — Snap build: no dashboard templateThe PR snap contains no PASS — dashboard template absent from snap. ✅ Test 2 — Upgrade path:
|
| Scenario | Result |
|---|---|
| No dashboard template in PR snap | ✅ PASS |
prune_addons() deletes all dashboard resources on upgrade |
✅ PASS |
Namespace kubernetes-dashboard deleted after apply |
✅ PASS |
| No dashboard pods after upgrade | ✅ PASS |
enable-dashboard not in configure hook |
✅ PASS |
enable-dashboard config file not written to $SNAP_DATA/config/ |
✅ PASS |
dashboard-auth not in configure hook |
✅ PASS |
All test scenarios pass. The upgrade path cleanly removes the dashboard and its namespace with no manual intervention required.
snapd persists config values across upgrades. Add a post-refresh hook to unset the two keys removed in 1.36 so operators don't see stale values when running `snap get cdk-addons enable-dashboard`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Supplementary Test Report — post-refresh hook + Juju healthFollow-up to the earlier test report, covering the two gaps identified:
Test details### ✅ Test 5 — post-refresh hook unsets stale config keysRestored Installed PR snap (v2, includes Post-install config key state: Hook is present in the snap: PASS — ✅ Test 6 — Juju unit health after snap swapPASS — unit remains Updated summary
All scenarios pass. PR is good to go. 🎉 |
Summary
Removes the Kubernetes Dashboard addon from
cdk-addonsas part of the CK 1.36 cleanup. No cleanup code is required —prune_addons()already handles label-based resource deletion, and apost-refreshhook unsets the now-removed config keys from snapd's DB.Changes
cdk-addons/apply: Removed theif get_snap_config("enable-dashboard") == "true":block (~8 lines). Removedkubernetes-dashboardfromdeletable_namespaces(no longer needed since we're not creating it).Makefile: RemovedKUBE_DASHBOARD_COMMIT=...variable and its reference in thepreptox target.get-addon-templates: Removedkubernetes_dashboard_repo = repo_cloner(...)definition, thepatch_dashboard()function, and thewith kubernetes_dashboard_repo() as repo:block.cdk-addons/meta/hooks/configure: Removedenable-dashboardanddashboard-authfrom the config key loop.cdk-addons/meta/hooks/post-refresh(new): Unsetsenable-dashboardanddashboard-authfrom snapd's config store on upgrade, so operators no longer see stale values when runningsnap get cdk-addons enable-dashboard.How cleanup works on upgrade
On snap refresh from ≤1.35:
applyno longer renderskubernetes-dashboard.yamlinto the addon dirprune_addons()detects all resources labelledcdk-addons=truethat are no longer in the addon dir and deletes themkubernetes-dashboardnamespace is explicitly deleted viakubectl delete namespace kubernetes-dashboardpost-refreshhook unsets the now-orphanedenable-dashboardanddashboard-authsnapd config keysMigration path for operators
Deploy the upstream dashboard:
Testing
prune_addons()removes dashboard resourcessnap get cdk-addons enable-dashboardreturns an error after upgrade (key unset by post-refresh hook)