From 2955891a3c79e9f5f26880440ecbf4403463d989 Mon Sep 17 00:00:00 2001 From: Verdict-as-a-Service Team Date: Tue, 18 Jun 2024 17:43:37 +0200 Subject: [PATCH] fix condition --- charts/vaas/templates/gdscan/update.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/vaas/templates/gdscan/update.yaml b/charts/vaas/templates/gdscan/update.yaml index ccadab6..b5d13c7 100644 --- a/charts/vaas/templates/gdscan/update.yaml +++ b/charts/vaas/templates/gdscan/update.yaml @@ -60,7 +60,8 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} {{- include "gdscan.imagePullSecrets" . | nindent 10 }} - {{- if gt (len (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets) 0 }} + {{- if (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets}} + {{- if (gt (len (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets) 0) }} volumes: {{- range (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets }} - name: {{ .name }} @@ -68,6 +69,7 @@ spec: secretName: {{ .name }} {{- end }} {{- end }} + {{- end }} containers: - name: kubectl image: "{{ .Values.gdscan.autoUpdate.image.registry }}/{{ .Values.gdscan.autoUpdate.image.repository }}:{{ .Values.gdscan.autoUpdate.image.tag }}" @@ -87,13 +89,15 @@ spec: IMAGE="{{ .Values.gdscan.autoUpdate.image.registry }}/{{ .Values.gdscan.autoUpdate.image.repository }}:$LATEST" echo "Setting image of $RESOURCE to $IMAGE" #kubectl set-image -n {{ .Release.Namespace }} $RESOURCE $IMAGE - {{- if gt (len (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets) 0 }} + {{- if (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets}} + {{- if (gt (len (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets) 0) }} volumeMounts: {{- range (include "gdscan.imagePullSecrets" . | fromYaml ).imagePullSecrets }} - name: {{ .name }} mountPath: "/home/appuser/.image_pull_secrets/{{ .name }}" {{- end }} {{- end }} + {{- end }} {{- if .Values.gdscan.autoUpdate.networkPolicy.enabled }} --- apiVersion: networking.k8s.io/v1