fix: add ClusterRole for runner SA to verify headlamp-e2e namespace
kubectl get namespace is cluster-scoped and requires a ClusterRole. The runner SA only had a namespaced Role, causing E2E to fail with Forbidden even when the namespace existed. Adds a minimal ClusterRole restricted to get on headlamp-e2e only. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -45,3 +45,29 @@ roleRef:
|
|||||||
kind: Role
|
kind: Role
|
||||||
name: e2e-ci-runner
|
name: e2e-ci-runner
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
---
|
||||||
|
# ClusterRole to allow the runner SA to verify the headlamp-e2e namespace
|
||||||
|
# exists before attempting namespaced operations. kubectl get namespace is a
|
||||||
|
# cluster-scoped operation not coverable by a namespaced Role.
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: e2e-ci-namespace-reader
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["namespaces"]
|
||||||
|
verbs: ["get"]
|
||||||
|
resourceNames: ["headlamp-e2e"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: e2e-ci-namespace-reader-binding
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: runners-privilegedescalation-gha-rs-no-permission
|
||||||
|
namespace: arc-runners
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: e2e-ci-namespace-reader
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
|||||||
Reference in New Issue
Block a user