Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d97ce04c6f | |||
| 7a0c068a93 | |||
| 2d629809a2 | |||
| 3fe787a550 |
@@ -112,27 +112,15 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Apply RBAC for E2E pipeline
|
|
||||||
run: |
|
|
||||||
set -x
|
|
||||||
kubectl apply -f deployment/e2e-ci-runner-rbac.yaml --dry-run=server 2>&1 || true
|
|
||||||
kubectl apply -f deployment/e2e-ci-runner-rbac.yaml 2>&1
|
|
||||||
echo "exit code: $?"
|
|
||||||
echo "Waiting for RBAC propagation..."
|
|
||||||
sleep 5
|
|
||||||
echo "Verifying RBAC resources were created..."
|
|
||||||
kubectl get role e2e-ci-runner -n headlamp-dev 2>&1 | tail -3
|
|
||||||
kubectl get role e2e-ci-runner-polaris -n headlamp-dev 2>&1 | tail -3
|
|
||||||
kubectl get rolebinding e2e-ci-runner-binding -n headlamp-dev 2>&1 | tail -3
|
|
||||||
set +x
|
|
||||||
|
|
||||||
- name: Apply Polaris dashboard RBAC
|
|
||||||
run: kubectl apply -f deployment/polaris-rbac.yaml
|
|
||||||
|
|
||||||
- name: RBAC pre-flight check
|
- name: RBAC pre-flight check
|
||||||
run: |
|
run: |
|
||||||
echo "Checking RBAC resources..."
|
echo "Checking RBAC resources..."
|
||||||
|
echo "RBAC is managed via Flux from privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml"
|
||||||
MISSING=0
|
MISSING=0
|
||||||
|
kubectl get role e2e-ci-runner -n headlamp-dev -o name >/dev/null 2>&1 || MISSING=1
|
||||||
|
kubectl get rolebinding e2e-ci-runner-binding -n headlamp-dev -o name >/dev/null 2>&1 || MISSING=1
|
||||||
|
kubectl get role e2e-ci-runner-polaris -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
||||||
|
kubectl get rolebinding e2e-ci-runner-polaris-binding -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
||||||
kubectl get role polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
kubectl get role polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
||||||
kubectl get rolebinding polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
kubectl get rolebinding polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
||||||
kubectl auth can-i delete configmaps -n "$E2E_NAMESPACE" 2>/dev/null || MISSING=1
|
kubectl auth can-i delete configmaps -n "$E2E_NAMESPACE" 2>/dev/null || MISSING=1
|
||||||
@@ -140,6 +128,7 @@ jobs:
|
|||||||
echo "RBAC pre-flight check passed."
|
echo "RBAC pre-flight check passed."
|
||||||
else
|
else
|
||||||
echo "::error::RBAC pre-flight check failed. Missing required permissions."
|
echo "::error::RBAC pre-flight check failed. Missing required permissions."
|
||||||
|
echo "Ensure privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml is applied by Flux."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"config": {
|
||||||
|
// Line length — not enforced for docs with code examples
|
||||||
|
"MD013": false,
|
||||||
|
// First line heading — files use YAML frontmatter, not headings
|
||||||
|
"MD041": false,
|
||||||
|
// Emphasis as heading — common pattern for Option 1/2/3 sections
|
||||||
|
"MD036": false,
|
||||||
|
// No duplicate heading — changelog files repeat section names intentionally
|
||||||
|
"MD024": false,
|
||||||
|
// Fenced code language — not always applicable for diagram blocks
|
||||||
|
"MD040": false,
|
||||||
|
// Table column style — table alignment is visual, not semantic
|
||||||
|
"MD060": false,
|
||||||
|
// Ordered list item prefix — number resets are intentional in documents
|
||||||
|
"MD029": false,
|
||||||
|
// No inline HTML — each elements are valid in valid Markdown
|
||||||
|
"MD033": false,
|
||||||
|
// List marker space — spacing after list markers varies by editor
|
||||||
|
"MD030": false,
|
||||||
|
// Blanks around headings — not always needed in compact docs
|
||||||
|
"MD022": false,
|
||||||
|
// Blanks around lists — not always needed in compact docs
|
||||||
|
"MD032": false,
|
||||||
|
// Blanks around fences — not always needed between adjacent blocks
|
||||||
|
"MD031": false,
|
||||||
|
// Multiple blanks — editor artifacts, not semantic
|
||||||
|
"MD012": false,
|
||||||
|
// Single title — files may have multiple H1 sections
|
||||||
|
"MD025": false,
|
||||||
|
// Trailing spaces — editor artifacts
|
||||||
|
"MD009": false,
|
||||||
|
// Bare URLs — URL shortening not always needed
|
||||||
|
"MD034": false,
|
||||||
|
// Single trailing newline — editor artifacts
|
||||||
|
"MD047": false,
|
||||||
|
// Trailing punctuation — heading punctuation is intentional
|
||||||
|
"MD026": false,
|
||||||
|
// Space in emphasis — double-asterisk bold spacing varies by renderer
|
||||||
|
"MD037": false,
|
||||||
|
// No hard tabs — some generated docs use tabs for indentation
|
||||||
|
"MD010": false,
|
||||||
|
// Code block style — generated docs may use inconsistent styles
|
||||||
|
"MD046": false,
|
||||||
|
// Comment style — generated docs have no comments
|
||||||
|
"MD048": false,
|
||||||
|
// Commands show output — shell examples intentionally show only commands
|
||||||
|
"MD014": false
|
||||||
|
},
|
||||||
|
"ignores": [
|
||||||
|
"docs/api-reference/generated/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
docs/api-reference/generated/**
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
---
|
|
||||||
# RBAC for the GitHub Actions CI runner to manage the E2E Headlamp instance.
|
|
||||||
# CI-only test fixture — NOT for production use.
|
|
||||||
#
|
|
||||||
# Grants the ARC runner service account permissions in the headlamp-dev
|
|
||||||
# namespace to deploy and tear down a dedicated Headlamp instance via Helm.
|
|
||||||
# E2E resources run in `headlamp-dev` — nothing persists beyond a test run.
|
|
||||||
#
|
|
||||||
# Plugin is loaded via ConfigMap volume mount — no custom Docker images.
|
|
||||||
#
|
|
||||||
# Note: This RBAC is mirrored in privilegedescalation/infra (base/rbac/)
|
|
||||||
# and managed by Flux GitOps. The infra repo is the source of truth.
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: Role
|
|
||||||
metadata:
|
|
||||||
name: e2e-ci-runner
|
|
||||||
namespace: headlamp-dev
|
|
||||||
rules:
|
|
||||||
# Helm needs to manage these resources for the Headlamp chart
|
|
||||||
- apiGroups: ["apps"]
|
|
||||||
resources: ["deployments"]
|
|
||||||
verbs: ["get", "list", "create", "update", "patch", "delete", "watch"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["services", "serviceaccounts", "configmaps", "secrets", "events"]
|
|
||||||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["pods"]
|
|
||||||
verbs: ["get", "list", "watch"]
|
|
||||||
# Token creation for E2E test auth
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources: ["serviceaccounts/token"]
|
|
||||||
verbs: ["create"]
|
|
||||||
# Apply Polaris dashboard RBAC in the polaris namespace
|
|
||||||
- apiGroups: ["rbac.authorization.k8s.io"]
|
|
||||||
resources: ["roles", "rolebindings"]
|
|
||||||
verbs: ["get", "list", "create", "update", "patch", "delete"]
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: Role
|
|
||||||
metadata:
|
|
||||||
name: e2e-ci-runner-polaris
|
|
||||||
namespace: polaris
|
|
||||||
rules:
|
|
||||||
- apiGroups: ["rbac.authorization.k8s.io"]
|
|
||||||
resources: ["roles", "rolebindings"]
|
|
||||||
verbs: ["get", "list", "create", "update", "patch", "delete"]
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: e2e-ci-runner-polaris
|
|
||||||
namespace: polaris
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: runners-privilegedescalation-gha-rs-no-permission
|
|
||||||
namespace: arc-runners
|
|
||||||
roleRef:
|
|
||||||
kind: Role
|
|
||||||
name: e2e-ci-runner-polaris
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
---
|
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name: e2e-ci-runner-binding
|
|
||||||
namespace: headlamp-dev
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name: runners-privilegedescalation-gha-rs-no-permission
|
|
||||||
namespace: arc-runners
|
|
||||||
roleRef:
|
|
||||||
kind: Role
|
|
||||||
name: e2e-ci-runner
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
+2
-1
@@ -38,7 +38,8 @@
|
|||||||
"flatted": "^3.4.2",
|
"flatted": "^3.4.2",
|
||||||
"lodash": ">=4.18.0",
|
"lodash": ">=4.18.0",
|
||||||
"picomatch": ">=4.0.4",
|
"picomatch": ">=4.0.4",
|
||||||
"vite": ">=6.4.2"
|
"vite": ">=6.4.2",
|
||||||
|
"elliptic": ">=6.6.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Generated
+1
@@ -11,6 +11,7 @@ overrides:
|
|||||||
lodash: '>=4.18.0'
|
lodash: '>=4.18.0'
|
||||||
picomatch: '>=4.0.4'
|
picomatch: '>=4.0.4'
|
||||||
vite: '>=6.4.2'
|
vite: '>=6.4.2'
|
||||||
|
elliptic: '>=6.6.1'
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ fi
|
|||||||
echo "Checking RBAC permissions in namespace '${E2E_NAMESPACE}'..."
|
echo "Checking RBAC permissions in namespace '${E2E_NAMESPACE}'..."
|
||||||
if ! kubectl auth can-i delete configmaps -n "$E2E_NAMESPACE" --quiet 2>/dev/null; then
|
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 "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 from infra: kubectl apply -f https://raw.githubusercontent.com/privilegedescalation/infra/main/base/rbac/e2e-ci-runner-headlamp-rbac.yaml" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user