Skip to content

Commit

Permalink
updating vap tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jaydip Gabani <[email protected]>
  • Loading branch information
JaydipGabani committed Dec 4, 2024
1 parent cd0aedd commit 201cdfa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test/bats/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ teardown_file() {
}

@test "vap test" {
minor_version=$(echo "$KUBERNETES_VERSION" | cut -d'.' -f2)
if [ "$minor_version" -lt 28 ] || [ -z $ENABLE_VAP_TESTS ]; then
skip "skipping vap tests"
fi
local api="$(kubectl api-resources | grep validatingadmission)"
if [[ -z "$api" ]]; then
echo "vap is not enabled for the cluster. skip vap test"
Expand Down Expand Up @@ -97,6 +93,7 @@ teardown_file() {
kubectl delete --ignore-not-found -f ${BATS_TESTS_DIR}/constraints/all_ns_must_have_label_provided_vapbinding_scoped.yaml

wait_for_process ${WAIT_TIME} ${SLEEP_TIME} "kubectl delete --ignore-not-found -f ${BATS_TESTS_DIR}/templates/k8srequiredlabels_template_vap.yaml"
kubectl get validatingadmissionpolicybinding gatekeeper-all-must-have-label-scoped || kubectl get validatingadmissionpolicybinding gatekeeper-all-must-have-label
fi
}

Expand Down

0 comments on commit 201cdfa

Please sign in to comment.