diff --git a/assets/auto-deploy-app/templates/cronjob.yaml b/assets/auto-deploy-app/templates/cronjob.yaml index 9c09a81893143e962f5ec4bfe7f2a9a4934ae138..1dbc67cb2f02da4010e06486d0350942f52cedc6 100644 --- a/assets/auto-deploy-app/templates/cronjob.yaml +++ b/assets/auto-deploy-app/templates/cronjob.yaml @@ -55,8 +55,10 @@ items: track: "{{ $.Values.application.track }}" tier: cronjob spec: + {{- with $.Values.image.secrets }} imagePullSecrets: - {{- toYaml $.Values.image.secrets | nindent 14 }} + {{- toYaml . | nindent 12 }} + {{- end }} restartPolicy: {{ default "OnFailure" $jobConfig.restartPolicy }} {{- with $nodeSelectorConfig := default $.Values.nodeSelector $jobConfig.nodeSelector -}} {{- if $nodeSelectorConfig }} @@ -73,7 +75,7 @@ items: {{- with $tolerationsConfig := default $.Values.tolerations $jobConfig.tolerations -}} {{- if $tolerationsConfig }} tolerations: - {{- toYaml $tolerationsConfig | nindent 14 }} + {{- toYaml $tolerationsConfig | nindent 12 }} {{- end }} {{- end }} {{- with $affinityConfig := default $.Values.affinity $jobConfig.affinity -}} @@ -84,7 +86,7 @@ items: {{- end }} {{- if $jobConfig.extraVolumes }} volumes: - {{- toYaml $jobConfig.extraVolumes | nindent 14 }} + {{- toYaml $jobConfig.extraVolumes | nindent 12 }} {{- end }} containers: - name: {{ $.Chart.Name }} @@ -198,7 +200,7 @@ items: {{- toYaml $.Values.resources | nindent 16 }} {{- if $jobConfig.extraVolumeMounts }} volumeMounts: - {{- toYaml $jobConfig.extraVolumeMounts | nindent 16 }} + {{- toYaml $jobConfig.extraVolumeMounts | nindent 14 }} {{- end }} {{- end -}} {{- end -}} diff --git a/assets/auto-deploy-app/templates/db-initialize-job.yaml b/assets/auto-deploy-app/templates/db-initialize-job.yaml index 923e12e4fdd32f5cf38c7682945bb0ed85924e2d..16be269d4859bb3e5e8b6101c359ce39b83a0874 100644 --- a/assets/auto-deploy-app/templates/db-initialize-job.yaml +++ b/assets/auto-deploy-app/templates/db-initialize-job.yaml @@ -16,8 +16,10 @@ spec: {{ include "sharedlabels" . | indent 8 }} spec: restartPolicy: Never + {{- with $.Values.image.secrets }} imagePullSecrets: - {{- toYaml .Values.image.secrets | nindent 8 }} + {{- toYaml . | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: {{ template "imagename" . }} diff --git a/assets/auto-deploy-app/templates/db-migrate-hook.yaml b/assets/auto-deploy-app/templates/db-migrate-hook.yaml index efa24b4f68391e13c238259a23237639f0099ebf..9b87f90b5d3e638661dce824ce74cf62d5658fbc 100644 --- a/assets/auto-deploy-app/templates/db-migrate-hook.yaml +++ b/assets/auto-deploy-app/templates/db-migrate-hook.yaml @@ -16,8 +16,10 @@ spec: {{ include "sharedlabels" . | indent 8 }} spec: restartPolicy: Never + {{- with $.Values.image.secrets }} imagePullSecrets: - {{- toYaml .Values.image.secrets | nindent 8 }} + {{- toYaml . | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: {{ template "imagename" . }} diff --git a/assets/auto-deploy-app/templates/deployment.yaml b/assets/auto-deploy-app/templates/deployment.yaml index 4e9f9a12aadaf15353e108e10e7fee1c4d9844ce..2ae52b35dd927e694ccb832c44937ad6f61a9de9 100644 --- a/assets/auto-deploy-app/templates/deployment.yaml +++ b/assets/auto-deploy-app/templates/deployment.yaml @@ -47,8 +47,10 @@ spec: {{- if or (.Values.serviceAccount.name) (.Values.serviceAccountName) }} serviceAccountName: {{ .Values.serviceAccount.name | default .Values.serviceAccountName | quote }} {{- end }} + {{- with $.Values.image.secrets }} imagePullSecrets: -{{- toYaml .Values.image.secrets | nindent 8 }} + {{- toYaml . | nindent 6 }} + {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} @@ -69,7 +71,7 @@ spec: {{- end }} {{- if .Values.tolerations }} tolerations: -{{- toYaml .Values.tolerations | nindent 8 }} +{{- toYaml .Values.tolerations | nindent 6 }} {{- end }} {{- if .Values.affinity }} affinity: @@ -77,31 +79,31 @@ spec: {{- end }} {{- if .Values.initContainers }} initContainers: -{{- toYaml .Values.initContainers | nindent 8 }} +{{- toYaml .Values.initContainers | nindent 6 }} {{- end }} {{- if .Values.topologySpreadConstraints }} topologySpreadConstraints: -{{- toYaml .Values.topologySpreadConstraints | nindent 8 }} +{{- toYaml .Values.topologySpreadConstraints | nindent 6 }} {{- end }} {{- if or (.Values.persistence.enabled) (.Values.extraVolumes) }} volumes: {{- if .Values.persistence.enabled }} {{- $context := . }} {{- range $volume := .Values.persistence.volumes }} - - name: {{ $volume.name | quote }} - persistentVolumeClaim: - {{- $args := dict "context" $context "name" $volume.name }} - claimName: {{ template "pvcName" $args }} + - name: {{ $volume.name | quote }} + persistentVolumeClaim: + {{- $args := dict "context" $context "name" $volume.name }} + claimName: {{ template "pvcName" $args }} {{- end }} {{- end }} {{- if .Values.extraVolumes }} -{{- toYaml .Values.extraVolumes | nindent 8 }} +{{- toYaml .Values.extraVolumes | nindent 6 }} {{- end }} {{- end }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} {{- if .Values.hostAliases }} hostAliases: -{{- toYaml .Values.hostAliases | nindent 8 }} +{{- toYaml .Values.hostAliases | nindent 6 }} {{- end }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} @@ -196,7 +198,7 @@ spec: {{- else if eq .Values.livenessProbe.probeType "exec" }} exec: command: -{{- toYaml .Values.livenessProbe.command | nindent 14 }} +{{- toYaml .Values.livenessProbe.command | nindent 12 }} {{- end }} initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} @@ -221,7 +223,7 @@ spec: {{- else if eq .Values.readinessProbe.probeType "exec" }} exec: command: -{{- toYaml .Values.readinessProbe.command | nindent 14 }} +{{- toYaml .Values.readinessProbe.command | nindent 12 }} {{- end }} initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} @@ -246,7 +248,7 @@ spec: {{- else if eq .Values.startupProbe.probeType "exec" }} exec: command: -{{- toYaml .Values.startupProbe.command | nindent 14 }} +{{- toYaml .Values.startupProbe.command | nindent 12 }} {{- end }} initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }} timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }} @@ -263,15 +265,15 @@ spec: volumeMounts: {{- if .Values.persistence.enabled }} {{- range $volume := .Values.persistence.volumes }} - - name: {{ $volume.name | quote }} - mountPath: {{ $volume.mount.path | quote }} - {{- if $volume.mount.subPath }} - subPath: {{ $volume.mount.subPath | quote }} - {{- end }} + - name: {{ $volume.name | quote }} + mountPath: {{ $volume.mount.path | quote }} + {{- if $volume.mount.subPath }} + subPath: {{ $volume.mount.subPath | quote }} + {{- end }} {{- end }} {{- end }} {{- if .Values.extraVolumeMounts }} -{{- toYaml .Values.extraVolumeMounts | nindent 10 }} +{{- toYaml .Values.extraVolumeMounts | nindent 8 }} {{- end }} {{- end }} {{- end -}} diff --git a/assets/auto-deploy-app/templates/pvc.yaml b/assets/auto-deploy-app/templates/pvc.yaml index 210d098d7ddebcefe4047fdcc3adfb1e5dbf8311..4655ed128a1e10d91640c1be458eee83689d41a5 100644 --- a/assets/auto-deploy-app/templates/pvc.yaml +++ b/assets/auto-deploy-app/templates/pvc.yaml @@ -13,7 +13,7 @@ metadata: {{ include "sharedlabels" $context | indent 4 }} spec: accessModes: - - {{ $volume.claim.accessMode | quote }} + - {{ $volume.claim.accessMode | quote }} resources: requests: storage: {{ $volume.claim.size | quote }} diff --git a/assets/auto-deploy-app/templates/worker-deployment.yaml b/assets/auto-deploy-app/templates/worker-deployment.yaml index 07cacb458d5496cc480d9bfabb91ac1556c02a75..856aed72f2bf18eb2eaf98bf664441e21c33f4bb 100644 --- a/assets/auto-deploy-app/templates/worker-deployment.yaml +++ b/assets/auto-deploy-app/templates/worker-deployment.yaml @@ -57,9 +57,9 @@ items: {{- end }} imagePullSecrets: {{- if and $workerConfig.image $workerConfig.image.secrets }} -{{- toYaml $workerConfig.image.secrets | nindent 10 }} -{{- else }} -{{- toYaml $.Values.image.secrets | nindent 10 }} +{{- toYaml $workerConfig.image.secrets | nindent 8 }} +{{- else if $.Values.image.secrets }} +{{- toYaml $.Values.image.secrets | nindent 8 }} {{- end }} {{- with $nodeSelectorConfig := default $.Values.nodeSelector $workerConfig.nodeSelector -}} {{- if $nodeSelectorConfig }} @@ -92,7 +92,7 @@ items: {{- with $tolerationsConfig := default $.Values.tolerations $workerConfig.tolerations -}} {{- if $tolerationsConfig }} tolerations: -{{- toYaml $tolerationsConfig | nindent 10 }} +{{- toYaml $tolerationsConfig | nindent 8 }} {{- end }} {{- end }} {{- with $affinityConfig := default $.Values.affinity $workerConfig.affinity -}} @@ -104,17 +104,17 @@ items: {{- with $initContainersConfig := default $.Values.initContainers $workerConfig.initContainers -}} {{- if $initContainersConfig }} initContainers: -{{- toYaml $initContainersConfig | nindent 10 }} +{{- toYaml $initContainersConfig | nindent 8 }} {{- end }} {{- end }} terminationGracePeriodSeconds: {{ $workerConfig.terminationGracePeriodSeconds }} {{- if $workerConfig.hostAliases }} hostAliases: -{{- toYaml $workerConfig.hostAliases | nindent 10 }} +{{- toYaml $workerConfig.hostAliases | nindent 8 }} {{- end }} {{- if $workerConfig.extraVolumes }} volumes: -{{- toYaml $workerConfig.extraVolumes | nindent 10 }} +{{- toYaml $workerConfig.extraVolumes | nindent 8 }} {{- end }} containers: - name: {{ $.Chart.Name }}-{{ $workerName }} @@ -167,7 +167,7 @@ items: {{- else if eq $livenessProbeConfig.probeType "exec" }} exec: command: -{{- toYaml $livenessProbeConfig.command | nindent 16 }} +{{- toYaml $livenessProbeConfig.command | nindent 14 }} {{- end }} initialDelaySeconds: {{ $livenessProbeConfig.initialDelaySeconds }} timeoutSeconds: {{ $livenessProbeConfig.timeoutSeconds }} @@ -194,7 +194,7 @@ items: {{- else if eq $readinessProbeConfig.probeType "exec" }} exec: command: -{{- toYaml $readinessProbeConfig.command | nindent 16 }} +{{- toYaml $readinessProbeConfig.command | nindent 14 }} {{- end }} initialDelaySeconds: {{ $readinessProbeConfig.initialDelaySeconds }} timeoutSeconds: {{ $readinessProbeConfig.timeoutSeconds }} @@ -222,7 +222,7 @@ items: {{ $workerConfig.resources | default $.Values.resources | toYaml | indent 12 }} {{- if $workerConfig.extraVolumeMounts }} volumeMounts: -{{- toYaml $workerConfig.extraVolumeMounts | nindent 12 }} +{{- toYaml $workerConfig.extraVolumeMounts | nindent 10 }} {{- end }} {{- end -}} {{- end -}} diff --git a/assets/auto-deploy-app/test/templates/test_helpers.go b/assets/auto-deploy-app/test/templates/test_helpers.go index 35caa3791968cbec5ae7a3902c38522223038cbe..13dfee18510ff14542fc08d889204ada5a32e2fe 100644 --- a/assets/auto-deploy-app/test/templates/test_helpers.go +++ b/assets/auto-deploy-app/test/templates/test_helpers.go @@ -59,9 +59,9 @@ func renderTemplate(t *testing.T, opts *helm.Options, releaseName string, templa } // yamllint with extra config - // check indenting of sequences, but don't enforce a particular style, since current style is very inconsistent + // check indenting of sequences with the default k8s style // disable trailing-space check, because sometimes we have empty variables and we don't want to use if blocks around every option - cmd := exec.Command("yamllint", "-s", "-d", "{extends: default, rules: {line-length: {max: 160}, indentation: {indent-sequences: whatever}, trailing-spaces: disable}}", "-") + cmd := exec.Command("yamllint", "-s", "-d", "{extends: default, rules: {line-length: {max: 160}, indentation: {indent-sequences: false}, trailing-spaces: disable}}", "-") cmd.Stdin = strings.NewReader(output + "\n") var out strings.Builder cmd.Stdout = &out