refactor: replace kubectl exec/cp deploy with ConfigMap + init container #54

Closed
ghost wants to merge 4 commits from refactor/e2e-plugin-installer into main

4 Commits

Author SHA1 Message Date
hugh-hackman[bot] 3f16f5c360 ci: add kubectl setup step for E2E plugin deploy
The runner doesn't have kubectl pre-installed, so the deploy script
fails with 'command not found'. Add azure/setup-kubectl@v4 before
the deploy step.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-16 11:00:08 +00:00
hugh-hackman[bot] 76d2bd3d41 ci: add build + deploy step to E2E workflow
The E2E tests fail because the plugin is never actually deployed to
Headlamp before the tests run. This adds a build step and invokes the
deploy-plugin-to-headlamp.sh script (from this same PR) to push the
plugin via ConfigMap + init container before running Playwright.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-16 10:58:42 +00:00
Gandalf the Greybeard a383d32176 fix: flatten dist/ contents into plugin root during init container extraction
The init container extracted the tarball preserving the dist/ subdirectory,
placing main.js at /plugins/polaris/dist/main.js instead of /plugins/polaris/main.js
where Headlamp expects it. Add cp -a dist/* . && rm -rf dist after extraction to
flatten the build output into the plugin root directory.

Fixes 6/16 E2E test failures (settings + badge navigation timeouts).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-16 10:51:51 +00:00
Gandalf the Greybeard 840d55efac refactor: replace kubectl exec/cp plugin deploy with ConfigMap + init container
Redesigns E2E plugin deployment to eliminate all kubectl exec/cp access to
Headlamp pods, per board policy. The new approach:

1. Packages built plugin as a tarball stored in a ConfigMap
2. Patches the Headlamp deployment with an init container that extracts
   the plugin into the static-plugins volume before Headlamp starts
3. Waits for rollout and verifies readiness

RBAC is reduced to configmaps (create/get/patch), deployments (get/patch),
replicasets and pods (get/list for rollout status) — no exec or cp needed.

Note: .github/workflows/e2e.yaml update requires workflows permission and
must be applied separately by a user with repo admin access.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-16 10:38:34 +00:00