
* fix serviceaccount and clusterrole name reference (full name) * add server.enabled option, align with documentation * add unit tests * update server.enabled behaviour to explicit true and update tests
33 lines
No EOL
916 B
Bash
33 lines
No EOL
916 B
Bash
#!/usr/bin/env bats
|
|
|
|
load _helpers
|
|
|
|
@test "csi/ClusterRole: disabled by default" {
|
|
cd `chart_dir`
|
|
local actual=$( (helm template \
|
|
--show-only templates/csi-clusterrole.yaml \
|
|
. || echo "---") | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "false" ]
|
|
}
|
|
|
|
@test "csi/ClusterRole: enabled with csi.enabled" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
--show-only templates/csi-clusterrole.yaml \
|
|
--set 'csi.enabled=true' \
|
|
. | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "true" ]
|
|
}
|
|
|
|
# ClusterRole name
|
|
@test "csi/ClusterRole: name" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
--show-only templates/csi-clusterrole.yaml \
|
|
--set "csi.enabled=true" \
|
|
. | tee /dev/stderr |
|
|
yq -r '.metadata.name' | tee /dev/stderr)
|
|
[ "${actual}" = "RELEASE-NAME-vault-csi-provider-clusterrole" ]
|
|
} |