Skip to content

Commit ebca208

Browse files
authored
Update rbac yaml template due to error when using variables inside of loop (#401)
* remove label variable from template Signed-off-by: Ben Luzarraga <luzarragaben@gmail.com> * debugging within loop Signed-off-by: Ben Luzarraga <luzarragaben@gmail.com> --------- Signed-off-by: Ben Luzarraga <luzarragaben@gmail.com>
1 parent 221df4d commit ebca208

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

helm/templates/00-rbac.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
{{- if .Values.global.instanceNamespace }}
77
{{- $namespaces = append $namespaces .Values.global.instanceNamespace }}
88
{{- end }}
9-
{{- if .Values.cpfs.labels }}
10-
{{- $labels := .Values.cpfs.labels }}
11-
{{- end }}
129
{{- range $i := $namespaces }}
1310
kind: Role
1411
apiVersion: rbac.authorization.k8s.io/v1
@@ -17,11 +14,11 @@ metadata:
1714
namespace: {{ $i }}
1815
labels:
1916
component-id: {{ $chartName }}
20-
{{- if .Values.cpfs.labels }}
21-
{{- with $labels }}
17+
{{- if $.Values.cpfs.labels }}
18+
{{- with $.Values.cpfs.labels }}
2219
{{- toYaml . | nindent 4 }}
2320
{{- end }}
24-
{{- end }}
21+
{{- end}}
2522
rules:
2623
- verbs:
2724
- create
@@ -102,11 +99,11 @@ metadata:
10299
namespace: {{ $i }}
103100
labels:
104101
component-id: {{ $chartName }}
105-
{{- if .Values.cpfs.labels }}
106-
{{- with $labels }}
102+
{{- if $.Values.cpfs.labels }}
103+
{{- with $.Values.cpfs.labels }}
107104
{{- toYaml . | nindent 4 }}
108105
{{- end }}
109-
{{- end }}
106+
{{- end}}
110107
subjects:
111108
- kind: ServiceAccount
112109
name: ibm-namespace-scope-operator
@@ -126,9 +123,9 @@ metadata:
126123
app.kubernetes.io/name: ibm-namespace-scope-operator
127124
component-id: {{ .Chart.Name }}
128125
{{- if .Values.cpfs.labels }}
129-
{{- with $labels }}
126+
{{- with .Values.cpfs.labels }}
130127
{{- toYaml . | nindent 4 }}
131128
{{- end }}
132-
{{- end }}
129+
{{- end}}
133130
name: ibm-namespace-scope-operator
134131
namespace: {{ .Values.global.operatorNamespace }}

0 commit comments

Comments
 (0)