Skip to content

Commit

Permalink
Add unit test for CONSUL_CACERT with Vault secret path
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancoleman committed Apr 27, 2023
1 parent b43d77f commit 3b596f7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions charts/consul/test/unit/api-gateway-controller-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,21 @@ load _helpers
[ "${actual}" = "true" ]
}

@test "apiGateway/Deployment: CONSUL_CACERT has correct path with Vault as secrets backend and client disabled" {
cd `chart_dir`
local actual=$(helm template \
-s templates/api-gateway-controller-deployment.yaml \
--set 'apiGateway.enabled=true' \
--set 'apiGateway.image=bar' \
--set 'global.tls.enabled=true' \
--set 'server.enabled=true' \
--set 'client.enabled=false' \
--set 'global.secretsBackend.vault.enabled=true' \
. | tee /dev/stderr|
yq '.spec.template.spec.containers[0].env[0].value == "/vault/secrets/serverca.crt"' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

@test "apiGateway/Deployment: CONSUL_CACERT is not set when using tls and useSystemRoots" {
cd `chart_dir`
local actual=$(helm template \
Expand Down

0 comments on commit 3b596f7

Please sign in to comment.