openbao-helm/test/unit/injector-service.bats

38 lines
1 KiB
Text
Raw Normal View History

#!/usr/bin/env bats
load _helpers
@test "injector/Service: service enabled by default" {
cd `chart_dir`
local actual=$(helm template \
-x templates/injector-service.yaml \
. | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
local actual=$(helm template \
-x templates/injector-service.yaml \
--set 'injector.enabled=true' \
. | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
}
@test "injector/Service: disable with global.enabled false" {
cd `chart_dir`
local actual=$(helm template \
-x templates/injector-service.yaml \
--set 'global.enabled=false' \
. | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ]
local actual=$(helm template \
-x templates/injector-service.yaml \
--set 'global.enabled=false' \
--set 'injector.enabled=true' \
. | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ]
}