Skip to content

Commit ad11f7c

Browse files
Ambient Code Botclaude
andcommitted
fix(manifests): fix RoleBinding subject namespace via Kustomize replacement
- Remove duplicated ClusterRole/ClusterRoleBinding from mpp-openshift overlay (already covered by base/rbac/control-plane-clusterrole.yaml) - Keep only the MPP-specific Role/RoleBinding for tenantnamespaces.tenant.paas.redhat.com - Add Kustomize replacement to inject the overlay namespace into subjects[0].namespace so any overlay deploying to a different namespace automatically binds the correct SA Previously the subject was hardcoded to ambient-code--runtime-int, causing Forbidden errors when the CP runs in a different namespace (e.g. ambient-code--ambient-s0). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0718d30 commit ad11f7c

2 files changed

Lines changed: 12 additions & 28 deletions

File tree

components/manifests/overlays/mpp-openshift/ambient-control-plane-rbac.yaml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,4 @@
11
apiVersion: rbac.authorization.k8s.io/v1
2-
kind: ClusterRole
3-
metadata:
4-
name: ambient-control-plane-project-namespaces
5-
rules:
6-
- apiGroups: [""]
7-
resources: ["secrets", "serviceaccounts", "services"]
8-
verbs: ["get", "list", "watch", "create", "delete", "deletecollection"]
9-
- apiGroups: [""]
10-
resources: ["pods"]
11-
verbs: ["get", "list", "watch", "delete", "deletecollection"]
12-
- apiGroups: ["rbac.authorization.k8s.io"]
13-
resources: ["rolebindings"]
14-
verbs: ["get", "list", "watch", "create", "delete"]
15-
---
16-
apiVersion: rbac.authorization.k8s.io/v1
17-
kind: ClusterRoleBinding
18-
metadata:
19-
name: ambient-control-plane-project-namespaces
20-
roleRef:
21-
apiGroup: rbac.authorization.k8s.io
22-
kind: ClusterRole
23-
name: ambient-control-plane-project-namespaces
24-
subjects:
25-
- kind: ServiceAccount
26-
name: ambient-control-plane
27-
namespace: ambient-code--runtime-int
28-
---
29-
apiVersion: rbac.authorization.k8s.io/v1
302
kind: Role
313
metadata:
324
name: ambient-control-plane-tenant-namespaces

components/manifests/overlays/mpp-openshift/kustomization.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ resources:
1515
- ambient-control-plane-rbac.yaml
1616
- ambient-tenant-ingress-netpol.yaml
1717

18+
replacements:
19+
- source:
20+
kind: ServiceAccount
21+
name: ambient-control-plane
22+
fieldPath: metadata.namespace
23+
targets:
24+
- select:
25+
kind: RoleBinding
26+
name: ambient-control-plane-tenant-namespaces
27+
fieldPaths:
28+
- subjects.0.namespace
29+
1830
patches:
1931
- path: ambient-api-server-args-patch.yaml
2032
target:

0 commit comments

Comments
 (0)