Skip to content

Commit

Permalink
removing wait of vapb deletion
Browse files Browse the repository at this point in the history
Signed-off-by: Jaydip Gabani <gabanijaydip@gmail.com>
  • Loading branch information
JaydipGabani committed Nov 28, 2024
1 parent c3448d4 commit 095e8cf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
15 changes: 0 additions & 15 deletions test/bats/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,6 @@ wait_for_process() {
return 1
}

wait_for_error() {
wait_time="$1"
sleep_time="$2"
cmd="$3"
while [ "$wait_time" -gt 0 ]; do
if eval "$cmd"; then
sleep "$sleep_time"
wait_time=$((wait_time - sleep_time))
else
return 0
fi
done
return 1
}

get_ca_cert() {
destination="$1"
if [ $(kubectl get secret -n ${GATEKEEPER_NAMESPACE} gatekeeper-webhook-server-cert -o jsonpath='{.data.ca\.crt}' | wc -w) -eq 0 ]; then
Expand Down
4 changes: 0 additions & 4 deletions test/bats/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ 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"
wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding all-must-have-label-scoped"
wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding all-must-have-label"
wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding gatekeeper-all-must-have-label-scoped"
wait_for_error ${WAIT_TIME} ${SLEEP_TIME} "kubectl get ValidatingAdmissionPolicyBinding gatekeeper-all-must-have-label"
fi
}

Expand Down

0 comments on commit 095e8cf

Please sign in to comment.