Commit 78bed5fd authored by Madhusudan.C.S's avatar Madhusudan.C.S

[Federation] Wait after cleanup only if the cleanup succeeds.

It is a waste of time to wait for the resources to cleanup if the cleanup fails.
parent 01c45f7d
...@@ -32,24 +32,28 @@ prepare-e2e ...@@ -32,24 +32,28 @@ prepare-e2e
if [[ "${FEDERATION:-}" == "true" ]];then if [[ "${FEDERATION:-}" == "true" ]];then
source "${KUBE_ROOT}/federation/cluster/common.sh" source "${KUBE_ROOT}/federation/cluster/common.sh"
cleanup-federation-api-objects || echo "Couldn't cleanup federation api objects" if cleanup-federation-api-objects; then
# TODO(madhusudancs): This is an arbitrary amount of sleep to give
# TODO(madhusudancs): This is an arbitrary amount of sleep to give Kubernetes # Kubernetes clusters enough time to delete the underlying cloud
# clusters enough time to delete the underlying cloud provider resources # provider resources corresponding to the Kubernetes resources we
# corresponding to the Kubernetes resources we deleted as part of the test # deleted as part of the test tear downs. It is shameful that we
# teardowns. It is shameful that we are doing this, but this is just a bandage # are doing this, but this is just a bandage to stop the bleeding.
# to stop the bleeding. Please don't use this pattern anywhere. Remove this # Please don't use this pattern anywhere. Remove this when proper
# when proper cloud provider cleanups are implemented in the individual test # cloud provider cleanups are implemented in the individual test
# `AfterEach` blocks. # `AfterEach` blocks.
sleep 2m # Also, we wait only if the cleanup succeeds.
sleep 2m
for zone in ${E2E_ZONES};do else
echo "Couldn't cleanup federation api objects"
fi
for zone in ${E2E_ZONES}; do
# bring down an e2e cluster # bring down an e2e cluster
( (
set-federation-zone-vars "$zone" set-federation-zone-vars "$zone"
test-teardown test-teardown
) )
done done
else else
test-teardown test-teardown
fi fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment