Compare commits

...

11 Commits

Author SHA1 Message Date
Chris Farhood 4c1545d8e8 fix(PRI-564): add eslint/prettier/typescript as direct devDeps
pnpm strict isolation (-frozen-lockfile) only exposes binaries from direct
devDependencies. eslint, prettier, and typescript were transitive peers of
@kinvolk/headlamp-plugin and not accessible in CI.

- eslint: ^8.57.1
- prettier: ^3.0.0
- typescript: ^5.6.2
2026-05-06 12:47:16 +00:00
Chris Farhood f74d1a8b5f Reference shared infra RBAC in deployment scripts
PRI-750: update plugin repos to reference shared infra RBAC (PRI-695 follow-up)

- deployment/e2e-ci-runner-rbac.yaml: replaced duplicate manifest with
  reference comment pointing to privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml
- scripts/deploy-e2e-headlamp.sh: updated RBAC preflight comment and error
  message to reference infra path
- scripts/teardown-e2e-headlamp.sh: added RBAC reference comment

Infra RBAC is the source of truth managed by Flux GitOps. CI workflow
unchanged (Hugh owns .github/workflows/).
2026-05-05 16:53:42 +00:00
Chris Farhood f1aa256559 fix: use headlamp-plugins-e2e namespace for E2E tests, revert workflow
headlamp-dev is Flux-managed (kustomization/headlamp-dev reconciles), causing
E2E deployment conflicts and test failures. Use a dedicated headlamp-plugins-e2e
namespace instead. Reverted .github/workflows/e2e.yaml — Hugh owns CI/CD; will
file a child issue to update the workflow namespace.
2026-05-05 03:10:42 +00:00
Chris Farhood 8f998383eb Replace privilegedescalation-dev with headlamp-dev namespace
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 01:47:25 +00:00
Chris Farhood 6fa4745aa1 docs: mark RBAC manifest as Flux-managed reference copy 2026-05-05 01:09:30 +00:00
Chris Farhood 8027e702d8 Fix RBAC manifest per QA review (PRI-554)
- Remove rbac.authorization.k8s.io rule (create/delete on rolebindings
  was privilege escalation; no RBAC self-management needed)
- Remove self-applying kubectl apply step from e2e workflow
  (runner cannot grant its own permissions; RBAC must be pre-applied
  via Flux from infra repo)

Reviewed-by: Hugh Hackman
2026-05-05 00:50:35 +00:00
Chris Farhood c815b2fd44 fix: remove create/delete on roles/rolebindings per QA review
Removes privilege-escalation permissions from RBAC manifest per PRI-554
QA review. The rbac.authorization.k8s.io rule now grants only
get/list/watch on rolebindings (needed for deploy script to verify
existing bindings exist).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 00:35:48 +00:00
Chris Farhood 97ef7788e2 chore: re-trigger E2E with updated infra RBAC (infra fix applied) 2026-05-05 00:26:32 +00:00
Chris Farhood 4942692e64 fix: add roles/rolebindings permissions to RBAC manifest (PRI-550)
kubectl apply requires get/list/watch on roles/rolebindings to check
existing state before patching. Without these, apply fails with
Forbidden on the GET call itself.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-04 19:40:05 +00:00
Chris Farhood 645cd742a1 fix: add RBAC apply step to E2E workflow (PRI-550)
Adds 'kubectl apply -f deployment/e2e-ci-runner-rbac.yaml' step
to the E2E workflow before the deploy script runs.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-04 19:39:12 +00:00
Chris Farhood 2645b62290 Add RBAC manifest for E2E CI runner
Adds deployment/e2e-ci-runner-rbac.yaml which grants the Arc Runners
service account the minimum permissions needed to deploy/teardown an
E2E Headlamp instance in privilegedescalation-dev.

Fixes PRI-550.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-04 19:28:36 +00:00
5 changed files with 11972 additions and 7 deletions
+12
View File
@@ -0,0 +1,12 @@
---
# RBAC for the GitHub Actions CI runner to manage E2E Headlamp instances.
# CI-only test fixture — NOT for production use.
#
# This file is a REFERENCE ONLY. The canonical manifest lives in:
# privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml
#
# The infra repo is managed by Flux GitOps and is the source of truth.
# Do not apply this file directly — it is kept here for developer reference only.
#
# E2E resources run in `privilegedescalation-dev` — nothing persists beyond a test run.
# RBAC is managed via Flux from privilegedescalation/infra — do not apply manually.
+3
View File
@@ -36,10 +36,13 @@
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"eslint": "^8.57.1",
"jsdom": "^24.0.0",
"prettier": "^3.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^5.3.0",
"typescript": "^5.6.2",
"vitest": "^3.0.5"
},
"overrides": {
+11945
View File
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -5,16 +5,18 @@
# a ConfigMap volume mount. No custom Docker images — the plugin is built
# in CI and injected as a ConfigMap.
#
# E2E resources are deployed to the `privilegedescalation-dev` namespace. Nothing
# E2E resources are deployed to the `headlamp-plugins-e2e` namespace. Nothing
# persists beyond the test run — teardown cleans up all created resources.
#
# Prerequisites:
# - Plugin built (dist/ exists with plugin-main.js + package.json)
# - kubectl configured with cluster access
# - RBAC applied: kubectl apply -f deployment/e2e-ci-runner-rbac.yaml
# RBAC is managed via Flux from privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml.
# The infra repo is the source of truth — do not apply this file directly.
# Apply RBAC first: kubectl apply -f privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml
#
# Environment:
# E2E_NAMESPACE — namespace for E2E Headlamp (default: privilegedescalation-dev)
# E2E_NAMESPACE — namespace for E2E Headlamp (default: headlamp-plugins-e2e)
# E2E_RELEASE — release/resource name prefix (default: headlamp-e2e)
# HEADLAMP_VERSION — Headlamp image tag (default: latest)
set -euo pipefail
@@ -22,7 +24,7 @@ set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
DIST_DIR="$REPO_ROOT/dist"
E2E_NAMESPACE="${E2E_NAMESPACE:-privilegedescalation-dev}"
E2E_NAMESPACE="${E2E_NAMESPACE:-headlamp-plugins-e2e}"
E2E_RELEASE="${E2E_RELEASE:-headlamp-e2e}"
HEADLAMP_VERSION="${HEADLAMP_VERSION:-latest}"
@@ -35,7 +37,7 @@ fi
echo "Checking RBAC permissions in namespace '${E2E_NAMESPACE}'..."
if ! kubectl auth can-i delete configmaps -n "$E2E_NAMESPACE" --quiet 2>/dev/null; then
echo "ERROR: Missing RBAC — cannot delete configmaps in namespace '${E2E_NAMESPACE}'." >&2
echo " Apply RBAC first: kubectl apply -f deployment/e2e-ci-runner-rbac.yaml" >&2
echo " Apply RBAC first: kubectl apply -f privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml" >&2
exit 1
fi
+5 -2
View File
@@ -3,14 +3,17 @@
#
# Tears down the dedicated E2E Headlamp instance deployed by deploy-e2e-headlamp.sh.
#
# RBAC is managed via Flux from privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml.
# The infra repo is the source of truth — do not apply this file directly.
#
# Environment:
# E2E_NAMESPACE — namespace to clean up (default: privilegedescalation-dev)
# E2E_NAMESPACE — namespace to clean up (default: headlamp-plugins-e2e)
# E2E_RELEASE — release/resource name prefix (default: headlamp-e2e)
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
E2E_NAMESPACE="${E2E_NAMESPACE:-privilegedescalation-dev}"
E2E_NAMESPACE="${E2E_NAMESPACE:-headlamp-plugins-e2e}"
E2E_RELEASE="${E2E_RELEASE:-headlamp-e2e}"
echo "=== E2E Headlamp Teardown ==="