Skip to content

Commit

Permalink
fix: namespace cluster roles for multi chart install
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-newrelic committed Feb 20, 2025
1 parent 9f86268 commit fca5f03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/charts/mocked_backend/templates/k8s-api-access.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# namespace suffixes to avoid conflicts when installing chart multiple times
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -6,7 +7,6 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
# namespace suffix to avoid conflicts when installing chart multiple times
name: read-k8s-api-role-{{ .Values.namespace }}
# required rules copied from:
# - k8seventsreceiever: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/k8seventsreceiver/README.md#rbac
Expand Down Expand Up @@ -78,11 +78,11 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: read-k8s-api-binding
name: read-k8s-api-binding-{{ .Values.namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: read-k8s-api-role
name: read-k8s-api-role-{{ .Values.namespace }}
subjects:
- kind: ServiceAccount
name: read-k8s-api-account
Expand Down
6 changes: 3 additions & 3 deletions test/charts/nr_backend/templates/k8s-api-access.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# namespace suffixes to avoid conflicts when installing chart multiple times
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -6,7 +7,6 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
# namespace suffix to avoid conflicts when installing chart multiple times
name: read-k8s-api-role-{{ .Values.namespace }}
# required rules copied from:
# - k8seventsreceiever: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/k8seventsreceiver/README.md#rbac
Expand Down Expand Up @@ -78,11 +78,11 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: read-k8s-api-binding
name: read-k8s-api-binding-{{ .Values.namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: read-k8s-api-role
name: read-k8s-api-role-{{ .Values.namespace }}
subjects:
- kind: ServiceAccount
name: read-k8s-api-account
Expand Down

0 comments on commit fca5f03

Please sign in to comment.