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 b345f41
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 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,23 @@ 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 'global.tls.caCert.secretName=foo' \
--set 'server.enabled=true' \
--set 'client.enabled=false' \
--set 'global.secretsBackend.vault.enabled=true' \
--set 'global.secretsBackend.vault.consulServerRole=foo' \
. | 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 b345f41

Please sign in to comment.