Skip to content

Commit

Permalink
Use YQ@3 friendly select
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancoleman committed Oct 31, 2022
1 parent 735e781 commit 3196f84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions charts/consul/test/unit/api-gateway-controller-clusterrole.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ load _helpers
@test "apiGateway/ClusterRole: uses PodSecurityPolicy with apiGateway.enabled=true and global.enablePodSecurityPolicies=true" {
cd `chart_dir`
local actual=$(helm template \
-s templates/api-gateway-controller-clusterrole.yaml \
--set 'global.enablePodSecurityPolicies=true' \
--set 'apiGateway.enabled=true' \
--set 'apiGateway.image=foo' \
. | tee /dev/stderr |
yq '.rules[] | select(.resourceNames[] == "release-name-consul-api-gateway-controller") | select(.resources[] == "podsecuritypolicies") | length > 0' | tee /dev/stderr)
-s templates/api-gateway-controller-clusterrole.yaml \
--set 'global.enablePodSecurityPolicies=true' \
--set 'apiGateway.enabled=true' \
--set 'apiGateway.image=foo' \
. | tee /dev/stderr |
yq '.rules[] | select((.resourceNames[0] == "release-name-consul-api-gateway-controller") and (.resources[0] == "podsecuritypolicies")) | length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

0 comments on commit 3196f84

Please sign in to comment.