Skip to content

Commit

Permalink
Set -ca-certs correct if tls is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
clly committed May 16, 2023
1 parent 3eb4c75 commit cd27116
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions charts/consul/test/unit/telemetry-collector-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -866,16 +866,18 @@ load _helpers

}

@test "telemetryCollector/Deployment: CONSUL_HTTP_SSL set correctly when using TLS." {
@test "telemetryCollector/Deployment: -ca-certs set correctly when using TLS." {
cd `chart_dir`
local actual=$(helm template \
local flags=$(helm template \
-s templates/telemetry-collector-deployment.yaml \
--set 'telemetryCollector.enabled=true' \
--set 'telemetryCollector.image=bar' \
--set 'global.tls.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].env[3].value' | tee /dev/stderr)
[ "${actual}" = "\"true\"" ]
yq -r '.spec.template.spec.containers[1].args' | tee /dev/stderr)

local actual=$(echo $flags | yq -r '. | any(contains("-ca-certs=/consul/tls/ca/tls.crt"))' | tee /dev/stderr)
[ "${actual}" = 'true' ]
}

#--------------------------------------------------------------------
Expand Down

0 comments on commit cd27116

Please sign in to comment.