From 4f9b49c73ba309f27c1c2a6d156f6d761cbe0fe1 Mon Sep 17 00:00:00 2001 From: Thomas Eckert Date: Mon, 3 Oct 2022 17:16:01 -0400 Subject: [PATCH] Fix indent of nodeSelector and tolerations --- .../templates/server-acl-init-cleanup-job.yaml | 16 ++++++++-------- charts/consul/templates/server-acl-init-job.yaml | 16 ++++++++-------- .../test/unit/server-acl-init-cleanup-job.bats | 8 ++++---- charts/consul/test/unit/server-acl-init-job.bats | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/charts/consul/templates/server-acl-init-cleanup-job.yaml b/charts/consul/templates/server-acl-init-cleanup-job.yaml index f2342cf661..300818988c 100644 --- a/charts/consul/templates/server-acl-init-cleanup-job.yaml +++ b/charts/consul/templates/server-acl-init-cleanup-job.yaml @@ -62,14 +62,14 @@ spec: limits: memory: "50Mi" cpu: "50m" - {{- if .Values.global.acls.job.tolerations }} - tolerations: - {{ tpl .Values.global.acls.job.tolerations . | indent 12 | trim }} - {{- end }} - {{- if .Values.global.acls.job.nodeSelector }} - nodeSelector: - {{ tpl .Values.global.acls.job.nodeSelector . | indent 12 | trim }} - {{- end }} + {{- if .Values.global.acls.job.tolerations }} + tolerations: + {{ tpl .Values.global.acls.job.tolerations . | indent 12 | trim }} + {{- end }} + {{- if .Values.global.acls.job.nodeSelector }} + nodeSelector: + {{ tpl .Values.global.acls.job.nodeSelector . | indent 12 | trim }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/charts/consul/templates/server-acl-init-job.yaml b/charts/consul/templates/server-acl-init-job.yaml index 5ad02aa93f..1bf5267748 100644 --- a/charts/consul/templates/server-acl-init-job.yaml +++ b/charts/consul/templates/server-acl-init-job.yaml @@ -336,14 +336,14 @@ spec: limits: memory: "50Mi" cpu: "50m" - {{- if .Values.global.acls.job.tolerations }} - tolerations: - {{ tpl .Values.global.acls.job.tolerations . | indent 12 | trim }} - {{- end }} - {{- if .Values.global.acls.job.nodeSelector }} - nodeSelector: - {{ tpl .Values.global.acls.job.nodeSelector . | indent 12 | trim }} - {{- end }} + {{- if .Values.global.acls.job.tolerations }} + tolerations: + {{ tpl .Values.global.acls.job.tolerations . | indent 12 | trim }} + {{- end }} + {{- if .Values.global.acls.job.nodeSelector }} + nodeSelector: + {{ tpl .Values.global.acls.job.nodeSelector . | indent 12 | trim }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/charts/consul/test/unit/server-acl-init-cleanup-job.bats b/charts/consul/test/unit/server-acl-init-cleanup-job.bats index 3fee687e42..0fe599b2e2 100644 --- a/charts/consul/test/unit/server-acl-init-cleanup-job.bats +++ b/charts/consul/test/unit/server-acl-init-cleanup-job.bats @@ -80,7 +80,7 @@ load _helpers -s templates/server-acl-init-job.yaml \ --set 'global.acls.manageSystemACLs=true' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].tolerations' | tee /dev/stderr) + yq -r '.spec.template.spec.tolerations' | tee /dev/stderr) [ "${actual}" = "null" ] } @@ -91,7 +91,7 @@ load _helpers --set 'global.acls.manageSystemACLs=true' \ --set 'global.acls.job.tolerations=- key: value' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].tolerations[0].key' | tee /dev/stderr) + yq -r '.spec.template.spec.tolerations[0].key' | tee /dev/stderr) [ "${actual}" = "value" ] } @@ -101,7 +101,7 @@ load _helpers -s templates/server-acl-init-job.yaml \ --set 'global.acls.manageSystemACLs=true' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].nodeSelector' | tee /dev/stderr) + yq -r '.spec.template.spec.nodeSelector' | tee /dev/stderr) [ "${actual}" = "null" ] } @@ -112,6 +112,6 @@ load _helpers --set 'global.acls.manageSystemACLs=true' \ --set 'global.acls.job.nodeSelector=- key: value' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].nodeSelector[0].key' | tee /dev/stderr) + yq -r '.spec.template.spec.nodeSelector[0].key' | tee /dev/stderr) [ "${actual}" = "value" ] } diff --git a/charts/consul/test/unit/server-acl-init-job.bats b/charts/consul/test/unit/server-acl-init-job.bats index c60240601d..34ca59286a 100644 --- a/charts/consul/test/unit/server-acl-init-job.bats +++ b/charts/consul/test/unit/server-acl-init-job.bats @@ -1569,7 +1569,7 @@ load _helpers -s templates/server-acl-init-job.yaml \ --set 'global.acls.manageSystemACLs=true' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].tolerations' | tee /dev/stderr) + yq -r '.spec.template.spec.tolerations' | tee /dev/stderr) [ "${actual}" = "null" ] } @@ -1580,7 +1580,7 @@ load _helpers --set 'global.acls.manageSystemACLs=true' \ --set 'global.acls.job.tolerations=- key: value' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].tolerations[0].key' | tee /dev/stderr) + yq -r '.spec.template.spec.tolerations[0].key' | tee /dev/stderr) [ "${actual}" = "value" ] } @@ -1590,7 +1590,7 @@ load _helpers -s templates/server-acl-init-job.yaml \ --set 'global.acls.manageSystemACLs=true' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].nodeSelector' | tee /dev/stderr) + yq -r '.spec.template.spec.nodeSelector' | tee /dev/stderr) [ "${actual}" = "null" ] } @@ -1601,7 +1601,7 @@ load _helpers --set 'global.acls.manageSystemACLs=true' \ --set 'global.acls.job.nodeSelector=- key: value' \ . | tee /dev/stderr | - yq -r '.spec.template.spec.containers[0].nodeSelector[0].key' | tee /dev/stderr) + yq -r '.spec.template.spec.nodeSelector[0].key' | tee /dev/stderr) [ "${actual}" = "value" ] }