From 03efc3f7f52a679d4406e55086125fc01c58071e Mon Sep 17 00:00:00 2001 From: John Murret Date: Tue, 29 Mar 2022 07:07:48 -0600 Subject: [PATCH] Fixing broken unit tests --- charts/consul/templates/server-statefulset.yaml | 4 ++-- charts/consul/test/unit/server-statefulset.bats | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/consul/templates/server-statefulset.yaml b/charts/consul/templates/server-statefulset.yaml index d471159f61..d83e9d5c50 100644 --- a/charts/consul/templates/server-statefulset.yaml +++ b/charts/consul/templates/server-statefulset.yaml @@ -15,8 +15,8 @@ {{- if (and (and .Values.global.secretsBackend.vault.enabled .Values.global.tls.enabled) (not .Values.global.secretsBackend.vault.consulCARole)) }}{{ fail "global.secretsBackend.vault.consulCARole must be provided if global.secretsBackend.vault.enabled=true and global.tls.enabled=true" }}{{ end -}} {{- if (and .Values.global.enterpriseLicense.secretName (not .Values.global.enterpriseLicense.secretKey)) }}{{fail "enterpriseLicense.secretKey and secretName must both be specified." }}{{ end -}} {{- if (and (not .Values.global.enterpriseLicense.secretName) .Values.global.enterpriseLicense.secretKey) }}{{fail "enterpriseLicense.secretKey and secretName must both be specified." }}{{ end -}} -{{- if (and .Values.global.acls.bootstrapToken.secretName (not .Values.global.acls.bootstrapToken.secretKey)) }}{{fail "global.acls.bootstrapToken.secretKey and secretName must both be specified." }}{{ end -}} -{{- if (and (not .Values.global.acls.bootstrapToken.secretName) .Values.global.acls.bootstrapToken.secretKey) }}{{fail "global.acls.bootstrapToken.secretKey and secretName must both be specified." }}{{ end -}} +{{- if (and .Values.global.acls.bootstrapToken.secretName (not .Values.global.acls.bootstrapToken.secretKey)) }}{{fail "both global.acls.bootstrapToken.secretKey and global.acls.bootstrapToken.secretName must be set if one of them is provided." }}{{ end -}} +{{- if (and (not .Values.global.acls.bootstrapToken.secretName) .Values.global.acls.bootstrapToken.secretKey) }}{{fail "both global.acls.bootstrapToken.secretKey and global.acls.bootstrapToken.secretName must be set if one of them is provided." }}{{ end -}} # StatefulSet to run the actual Consul server cluster. apiVersion: apps/v1 kind: StatefulSet diff --git a/charts/consul/test/unit/server-statefulset.bats b/charts/consul/test/unit/server-statefulset.bats index f392b6ee50..7fbc20a97b 100755 --- a/charts/consul/test/unit/server-statefulset.bats +++ b/charts/consul/test/unit/server-statefulset.bats @@ -1239,7 +1239,7 @@ load _helpers --set 'global.acls.bootstrapToken.secretKey=enterpriselicense' \ . [ "$status" -eq 1 ] - [[ "$output" =~ "global.acls.bootstrapToken.secretKey and secretName must both be specified." ]] + [[ "$output" =~ "both global.acls.bootstrapToken.secretKey and global.acls.bootstrapToken.secretName must be set if one of them is provided." ]] } @test "server/StatefulSet: when global.acls.bootstrapToken.secretName!=null and global.acls.bootstrapToken.secretKey=null, fail" { @@ -1250,7 +1250,7 @@ load _helpers --set 'global.acls.bootstrapToken.secretKey=' \ . [ "$status" -eq 1 ] - [[ "$output" =~ "global.acls.bootstrapToken.secretKey and secretName must both be specified." ]] + [[ "$output" =~ "both global.acls.bootstrapToken.secretKey and global.acls.bootstrapToken.secretName must be set if one of them is provided." ]] } @test "server/StatefulSet: acl bootstrap token config is not set by default" {