63 lines
1.9 KiB
Text
63 lines
1.9 KiB
Text
![]() |
#!/usr/bin/env bats
|
||
|
|
||
|
load _helpers
|
||
|
|
||
|
@test "server/ClusterRoleBinding: disabled by default" {
|
||
|
cd `chart_dir`
|
||
|
local actual=$(helm template \
|
||
|
-x templates/server-clusterrolebinding.yaml \
|
||
|
--set 'server.dev.enabled=true' \
|
||
|
. | tee /dev/stderr |
|
||
|
yq 'length > 0' | tee /dev/stderr)
|
||
|
[ "${actual}" = "false" ]
|
||
|
|
||
|
local actual=$(helm template \
|
||
|
-x templates/server-clusterrolebinding.yaml \
|
||
|
--set 'server.ha.enabled=true' \
|
||
|
. | tee /dev/stderr |
|
||
|
yq 'length > 0' | tee /dev/stderr)
|
||
|
[ "${actual}" = "false" ]
|
||
|
|
||
|
local actual=$(helm template \
|
||
|
-x templates/server-clusterrolebinding.yaml \
|
||
|
. | tee /dev/stderr |
|
||
|
yq 'length > 0' | tee /dev/stderr)
|
||
|
[ "${actual}" = "false" ]
|
||
|
}
|
||
|
|
||
|
@test "server/ClusterRoleBinding: disable with global.enabled" {
|
||
|
cd `chart_dir`
|
||
|
local actual=$(helm template \
|
||
|
-x templates/server-clusterrolebinding.yaml \
|
||
|
--set 'global.enabled=false' \
|
||
|
. | tee /dev/stderr |
|
||
|
yq 'length > 0' | tee /dev/stderr)
|
||
|
[ "${actual}" = "false" ]
|
||
|
}
|
||
|
|
||
|
@test "server/ClusterRoleBinding: can enable with server.authDelegator" {
|
||
|
cd `chart_dir`
|
||
|
local actual=$(helm template \
|
||
|
-x templates/server-clusterrolebinding.yaml \
|
||
|
--set 'server.authDelegator.enabled=true' \
|
||
|
. | tee /dev/stderr |
|
||
|
yq 'length > 0' | tee /dev/stderr)
|
||
|
[ "${actual}" = "true" ]
|
||
|
|
||
|
local actual=$(helm template \
|
||
|
-x templates/server-clusterrolebinding.yaml \
|
||
|
--set 'server.authDelegator.enabled=true' \
|
||
|
--set 'server.ha.enabled=true' \
|
||
|
. | tee /dev/stderr |
|
||
|
yq 'length > 0' | tee /dev/stderr)
|
||
|
[ "${actual}" = "true" ]
|
||
|
|
||
|
local actual=$(helm template \
|
||
|
-x templates/server-clusterrolebinding.yaml \
|
||
|
--set 'server.authDelegator.enabled=true' \
|
||
|
--set 'server.dev.enabled=true' \
|
||
|
. | tee /dev/stderr |
|
||
|
yq 'length > 0' | tee /dev/stderr)
|
||
|
[ "${actual}" = "true" ]
|
||
|
}
|