This is an automated email from the ASF dual-hosted git repository.

husseinawala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 58eb19fe76 Remove unnecessary loops to load env from helm values 
(#33506)
58eb19fe76 is described below

commit 58eb19fe7669b61d0a00bcc82df16adee379a233
Author: Hussein Awala <[email protected]>
AuthorDate: Fri Aug 18 21:13:30 2023 +0200

    Remove unnecessary loops to load env from helm values (#33506)
---
 chart/templates/_helpers.yaml                 | 5 ++---
 chart/templates/statsd/statsd-deployment.yaml | 8 ++------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/chart/templates/_helpers.yaml b/chart/templates/_helpers.yaml
index 44b55c7868..75579b6248 100644
--- a/chart/templates/_helpers.yaml
+++ b/chart/templates/_helpers.yaml
@@ -245,9 +245,8 @@ If release name contains chart name it will be used as a 
full name.
     - name: GIT_SYNC_ONE_TIME
       value: "true"
     {{- end }}
-    {{- range $i, $config := .Values.dags.gitSync.env }}
-    - name: {{ $config.name }}
-      value: {{ $config.value | quote }}
+    {{- with .Values.dags.gitSync.env }}
+    {{- toYaml . | nindent 4 }}
     {{- end }}
   resources: {{ toYaml .Values.dags.gitSync.resources | nindent 6 }}
   volumeMounts:
diff --git a/chart/templates/statsd/statsd-deployment.yaml 
b/chart/templates/statsd/statsd-deployment.yaml
index 557bbc4f78..7d28a65399 100644
--- a/chart/templates/statsd/statsd-deployment.yaml
+++ b/chart/templates/statsd/statsd-deployment.yaml
@@ -97,12 +97,8 @@ spec:
             - "--statsd.mapping-config=/etc/statsd-exporter/mappings.yml"
           {{- end }}
           resources: {{- toYaml .Values.statsd.resources | nindent 12 }}
-          {{- if .Values.statsd.env }}
-          env:
-            {{- range $i, $config := .Values.statsd.env }}
-            - value: {{ $config.value | quote }}
-              name: {{ $config.name | quote }}
-            {{- end }}
+          {{- with .Values.statsd.env }}
+          env: {{- toYaml . | nindent 12 }}
           {{- end }}
           ports:
             - name: statsd-ingest

Reply via email to