Skip to content

Commit 47d824d

Browse files
authored
Update rbac yaml template due to error when using variables inside of loop (#1190)
* remove variable from template Signed-off-by: Ben Luzarraga <[email protected]> * debugging Signed-off-by: Ben Luzarraga <[email protected]> --------- Signed-off-by: Ben Luzarraga <[email protected]>
1 parent ade0bd1 commit 47d824d

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

helm/templates/rbac.yaml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ metadata:
1919
{{- if .Values.global.instanceNamespace }}
2020
{{- $namespaces = append $namespaces .Values.global.instanceNamespace }}
2121
{{- end }}
22-
{{- if .Values.cpfs.labels }}
23-
{{- $labels := .Values.cpfs.labels }}
24-
{{- end }}
2522
{{- range $i := $namespaces }}
2623
---
2724
apiVersion: rbac.authorization.k8s.io/v1
@@ -31,11 +28,11 @@ metadata:
3128
namespace: {{ $i }}
3229
labels:
3330
component-id: {{ $chartName }}
34-
{{- if .Values.cpfs.labels }}
35-
{{- with $labels }}
31+
{{- if $.Values.cpfs.labels }}
32+
{{- with $.Values.cpfs.labels }}
3633
{{- toYaml . | nindent 4 }}
3734
{{- end }}
38-
{{- end }}
35+
{{- end}}
3936
rules:
4037
- apiGroups:
4138
- ""
@@ -313,11 +310,11 @@ metadata:
313310
namespace: {{ $i }}
314311
labels:
315312
component-id: {{ $chartName }}
316-
{{- if .Values.cpfs.labels }}
317-
{{- with $labels }}
313+
{{- if $.Values.cpfs.labels }}
314+
{{- with $.Values.cpfs.labels }}
318315
{{- toYaml . | nindent 4 }}
319316
{{- end }}
320-
{{- end }}
317+
{{- end}}
321318
roleRef:
322319
apiGroup: rbac.authorization.k8s.io
323320
kind: Role
@@ -336,11 +333,11 @@ metadata:
336333
namespace: {{ $i }}
337334
labels:
338335
component-id: {{ $chartName }}
339-
{{- if .Values.cpfs.labels }}
340-
{{- with $labels }}
336+
{{- if $.Values.cpfs.labels }}
337+
{{- with $.Values.cpfs.labels }}
341338
{{- toYaml . | nindent 4 }}
342339
{{- end }}
343-
{{- end }}
340+
{{- end}}
344341
rules:
345342
- apiGroups:
346343
- operators.coreos.com
@@ -361,11 +358,11 @@ metadata:
361358
namespace: {{ $i }}
362359
labels:
363360
component-id: {{ $chartName}}
364-
{{- if .Values.cpfs.labels }}
365-
{{- with $labels }}
361+
{{- if $.Values.cpfs.labels }}
362+
{{- with $.Values.cpfs.labels }}
366363
{{- toYaml . | nindent 4 }}
367364
{{- end }}
368-
{{- end }}
365+
{{- end}}
369366
roleRef:
370367
apiGroup: rbac.authorization.k8s.io
371368
kind: Role

0 commit comments

Comments
 (0)