Skip to content

Commit

Permalink
add bats test
Browse files Browse the repository at this point in the history
  • Loading branch information
ndhanushkodi committed Jun 30, 2022
1 parent 0359a3b commit 7f2ab61
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,21 @@ load _helpers
yq '.webhooks[0].clientConfig.service.namespace' | tee /dev/stderr)
[ "${actual}" = "\"foo\"" ]
}

@test "connectInject/MutatingWebhookConfiguration: peering is enabled, so webhooks for peering exist" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-mutatingwebhookconfiguration.yaml \
--set 'connectInject.enabled=true' \
--set 'global.peering.enabled=true' \
. | tee /dev/stderr |
yq '.webhooks[1].name | contains("peeringacceptors.consul.hashicorp.com")' | tee /dev/stderr)
[ "${actual}" = "true" ]
local actual=$(helm template \
-s templates/connect-inject-mutatingwebhookconfiguration.yaml \
--set 'connectInject.enabled=true' \
--set 'global.peering.enabled=true' \
. | tee /dev/stderr |
yq '.webhooks[2].name | contains("peeringdialers.consul.hashicorp.com")' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

0 comments on commit 7f2ab61

Please sign in to comment.