simplify using with, thx @pborn-ionos!

Signed-off-by: wim.fournier <wim.fournier@adevinta.com>
This commit is contained in:
wim.fournier 2023-05-23 10:44:57 +02:00
parent 6bab7599a4
commit 7668f57b0c
8 changed files with 26 additions and 39 deletions

View file

@ -255,9 +255,9 @@ spec:
failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.controller.resources | nindent 10 }}
{{- if .Values.controller.containerSecurityContext.enabled }}
{{- with .Values.controller.containerSecurityContext }}
securityContext:
{{- omit .Values.controller.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
workingDir: /home/argocd
volumeMounts:

View file

@ -182,9 +182,9 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.applicationSet.resources | nindent 12 }}
{{- if .Values.applicationSet.containerSecurityContext.enabled }}
{{- with .Values.applicationSet.containerSecurityContext }}
securityContext:
{{- omit .Values.applicationSet.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- with .Values.applicationSet.extraVolumeMounts }}

View file

@ -80,9 +80,9 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.notifications.resources | nindent 12 }}
{{- if .Values.notifications.containerSecurityContext.enabled }}
{{- with .Values.notifications.containerSecurityContext }}
securityContext:
{{- omit .Values.notifications.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
workingDir: /app
volumeMounts:

View file

@ -273,9 +273,9 @@ spec:
failureThreshold: {{ .Values.repoServer.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.repoServer.resources | nindent 10 }}
{{- if .Values.repoServer.containerSecurityContext.enabled }}
{{- if .Values.repoServer.containerSecurityContext }}
securityContext:
{{- omit .Values.repoServer.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.repoServer.lifecycle }}
lifecycle:
@ -297,11 +297,9 @@ spec:
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.repoServer.containerSecurityContext.enabled }}
{{- with .Values.repoServer.containerSecurityContext }}
securityContext:
{{- omit . "enabled" | toYaml | nindent 10 }}
{{- end }}
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- mountPath: /var/run/argocd

View file

@ -334,9 +334,9 @@ spec:
failureThreshold: {{ .Values.server.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.server.resources | nindent 10 }}
{{- if .Values.server.containerSecurityContext.enabled }}
{{- with .Values.server.containerSecurityContext }}
securityContext:
{{- omit .Values.server.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.server.lifecycle }}
lifecycle:
@ -348,9 +348,9 @@ spec:
imagePullPolicy: {{ .Values.server.extensions.image.imagePullPolicy }}
resources:
{{- toYaml .Values.server.extensions.resources | nindent 10 }}
{{- if .Values.server.extensions.containerSecurityContext.enabled }}
{{- with .Values.server.extensions.containerSecurityContext }}
securityContext:
{{- omit .Values.server.extensions.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
- name: extensions

View file

@ -117,9 +117,9 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.dex.resources | nindent 10 }}
{{- if .Values.dex.containerSecurityContext.enabled }}
{{- with .Values.dex.containerSecurityContext }}
securityContext:
{{- omit .Values.dex.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
{{- with .Values.dex.volumeMounts }}
@ -150,9 +150,9 @@ spec:
name: dexconfig
resources:
{{- toYaml .Values.dex.resources | nindent 10 }}
{{- if .Values.dex.containerSecurityContext.enabled }}
{{- with .Values.dex.containerSecurityContext }}
securityContext:
{{- omit .Values.dex.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end}}
{{- with .Values.dex.initContainers }}
{{- tpl (toYaml .) $ | nindent 6 }}

View file

@ -41,11 +41,9 @@ spec:
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.redis.containerSecurityContext.enabled }}
{{- with .Values.redis.securityContext }}
securityContext:
{{- omit . "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redis.priorityClassName | default .Values.global.priorityClassName }}
priorityClassName: {{ . }}
@ -77,9 +75,9 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.redis.resources | nindent 10 }}
{{- if .Values.redis.containerSecurityContext.enabled }}
{{- with .Values.redis.containerSecurityContext }}
securityContext:
{{- omit .Values.redis.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.redis.volumeMounts }}
volumeMounts:
@ -103,9 +101,9 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.redis.exporter.resources | nindent 10 }}
{{- if .Values.redis.exporter.containerSecurityContext.enabled }}
{{- with .Values.redis.exporter.containerSecurityContext }}
securityContext:
{{- omit .Values.redis.exporter.containerSecurityContext "enabled" | toYaml | nindent 10 }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- with .Values.redis.extraContainers }}

View file

@ -699,7 +699,6 @@ controller:
# -- Application controller container-level security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
@ -1018,7 +1017,6 @@ dex:
# -- Dex container-level security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
@ -1170,7 +1168,6 @@ redis:
# -- Redis exporter security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
@ -1264,7 +1261,6 @@ redis:
# -- Redis container-level security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
allowPrivilegeEscalation: false
capabilities:
drop:
@ -1528,7 +1524,6 @@ server:
# -- Server UI extensions container-level security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
@ -1633,7 +1628,6 @@ server:
# -- Server container-level security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
@ -2165,7 +2159,6 @@ repoServer:
# -- Repo server container-level security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
@ -2519,7 +2512,6 @@ applicationSet:
# -- ApplicationSet controller container-level security context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
@ -2858,7 +2850,6 @@ notifications:
# -- Notification controller container-level security Context
# @default -- See [values.yaml]
containerSecurityContext:
enabled: true
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false