Skip to content

Commit e836a41

Browse files
authored
fix: replace break function in pod-launcher-rolebinding template (apache#49219)
1 parent e74d498 commit e836a41

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

chart/templates/rbac/pod-launcher-rolebinding.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,22 @@ roleRef:
5858
name: {{ include "airflow.fullname" . }}-pod-launcher-role
5959
{{- end }}
6060
subjects:
61+
{{- $schedulerAdded := false }}
6162
{{- range $executor := $executors }}
62-
{{- if has $executor $schedulerLaunchExecutors }}
63+
{{- if and (has $executor $schedulerLaunchExecutors) (not $schedulerAdded) }}
64+
{{- $schedulerAdded = true }}
6365
- kind: ServiceAccount
6466
name: {{ include "scheduler.serviceAccountName" $ }}
6567
namespace: "{{ $.Release.Namespace }}"
66-
{{- break -}}
6768
{{- end }}
6869
{{- end }}
70+
{{- $workerAdded := false }}
6971
{{- range $executor := $executors }}
70-
{{- if has $executor $workerLaunchExecutors }}
72+
{{- if and (has $executor $workerLaunchExecutors) (not $workerAdded) }}
73+
{{- $workerAdded = true }}
7174
- kind: ServiceAccount
7275
name: {{ include "worker.serviceAccountName" $ }}
7376
namespace: "{{ $.Release.Namespace }}"
74-
{{- break -}}
7577
{{- end }}
7678
{{- end }}
7779
{{- end }}

0 commit comments

Comments
 (0)