mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 20:12:43 +00:00
helm consul toegevoegd ma nie als submodule?
This commit is contained in:
55
consul-helm/test/unit/connect-inject-mutatingwebhook.bats
Executable file
55
consul-helm/test/unit/connect-inject-mutatingwebhook.bats
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load _helpers
|
||||
|
||||
@test "connectInject/MutatingWebhookConfiguration: disabled by default" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/connect-inject-mutatingwebhook.yaml \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "connectInject/MutatingWebhookConfiguration: enable with global.enabled false" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/connect-inject-mutatingwebhook.yaml \
|
||||
--set 'global.enabled=false' \
|
||||
--set 'client.enabled=true' \
|
||||
--set 'connectInject.enabled=true' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "true" ]
|
||||
}
|
||||
|
||||
@test "connectInject/MutatingWebhookConfiguration: disable with connectInject.enabled" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/connect-inject-mutatingwebhook.yaml \
|
||||
--set 'connectInject.enabled=false' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "connectInject/MutatingWebhookConfiguration: disable with global.enabled" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/connect-inject-mutatingwebhook.yaml \
|
||||
--set 'global.enabled=false' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "connectInject/MutatingWebhookConfiguration: namespace is set" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/connect-inject-mutatingwebhook.yaml \
|
||||
--set 'connectInject.enabled=true' \
|
||||
--namespace foo \
|
||||
. | tee /dev/stderr |
|
||||
yq '.webhooks[0].clientConfig.service.namespace' | tee /dev/stderr)
|
||||
[ "${actual}" = "\"foo\"" ]
|
||||
}
|
Reference in New Issue
Block a user