Skip to content

Commit

Permalink
Fixing broken unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret committed Mar 29, 2022
1 parent fcf9ec8 commit 03efc3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/consul/templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/consul/test/unit/server-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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" {
Expand Down

0 comments on commit 03efc3f

Please sign in to comment.