Skip to content

Commit e30845d

Browse files
committed
fixing name of the template to get vap
Signed-off-by: Jaydip Gabani <[email protected]>
1 parent 21b82c6 commit e30845d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/bats/test.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ setup() {
9090
echo "running integration test against policy group: $policy_group, constraint template: $template_name"
9191
# apply template
9292
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl apply -k $policy"
93+
local kind=$(yq e .metadata.name "$policy"/template.yaml)
9394
if [ "$POLICY_ENGINE" == "vap" ] && grep -q "engine: K8sNativeValidation" "$policy"/template.yaml; then
94-
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicy gatekeeper-$template_name"
95+
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicy gatekeeper-$kind"
9596
vapb_exists=true
9697
fi
97-
local kind=$(yq e .metadata.name "$policy"/template.yaml)
9898
for sample in "$policy"/samples/*; do
9999
echo "testing sample constraint: $(basename "$sample")"
100100
# apply constraint
@@ -103,7 +103,7 @@ setup() {
103103
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "constraint_enforced $kind $name"
104104

105105
if [ vapb_exists == true ]; then
106-
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding gatekeeper-$kind"
106+
wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding gatekeeper-$name"
107107
deny_substr="ValidatingAdmissionPolicy"
108108
fi
109109

0 commit comments

Comments
 (0)