Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[metricbeat] remove unneeded if statement for envFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlrt committed Apr 17, 2020
1 parent 055313c commit 890428d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 0 additions & 2 deletions metricbeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ spec:
{{- if .Values.extraEnvs | default .Values.daemonset.extraEnvs }}
{{ toYaml ( .Values.extraEnvs | default .Values.daemonset.extraEnvs ) | indent 8 }}
{{- end }}
{{- if .Values.envFrom | default .Values.daemonset.envFrom }}
envFrom: {{ toYaml ( .Values.envFrom | default .Values.daemonset.envFrom ) | nindent 10 }}
{{- end }}
securityContext: {{ toYaml ( .Values.podSecurityContext | default .Values.daemonset.securityContext ) | nindent 10 }}
volumeMounts:
{{- range .Values.secretMounts | default .Values.daemonset.secretMounts }}
Expand Down
2 changes: 0 additions & 2 deletions metricbeat/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ spec:
{{- if .Values.extraEnvs | default .Values.deployment.extraEnvs }}
{{ toYaml ( .Values.extraEnvs | default .Values.deployment.extraEnvs ) | indent 8 }}
{{- end }}
{{- if .Values.envFrom | default .Values.deployment.envFrom }}
envFrom: {{ toYaml ( .Values.envFrom | default .Values.deployment.envFrom ) | nindent 10 }}
{{- end }}
securityContext: {{ toYaml ( .Values.podSecurityContext | default .Values.deployment.securityContext ) | nindent 10 }}
volumeMounts:
{{- range .Values.secretMounts | default .Values.deployment.secretMounts }}
Expand Down
12 changes: 6 additions & 6 deletions metricbeat/tests/metricbeat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,10 +925,10 @@ def test_adding_env_from():
0
]["configMapRef"] == {"name": "configmap-name"}
assert (
"envFrom"
not in r["deployment"][name + "-metrics"]["spec"]["template"]["spec"][
"containers"
][0]
r["deployment"][name + "-metrics"]["spec"]["template"]["spec"]["containers"][0][
"envFrom"
]
== []
)

config = """
Expand All @@ -942,8 +942,8 @@ def test_adding_env_from():
0
]["envFrom"][0]["configMapRef"] == {"name": "configmap-name"}
assert (
"envFrom"
not in r["daemonset"][name]["spec"]["template"]["spec"]["containers"][0]
r["daemonset"][name]["spec"]["template"]["spec"]["containers"][0]["envFrom"]
== []
)


Expand Down

0 comments on commit 890428d

Please sign in to comment.