Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit a41f386

Browse files
authored
Merge pull request #46 from mucahitkurt/kind-cluster-cleanup
delete kind cluster after tests run
2 parents 4fcafec + 1eaaaa1 commit a41f386

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: prow.sh

+15
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,19 @@ EOF
580580
export KUBECONFIG
581581
}
582582

583+
# Deletes kind cluster inside a prow job
584+
delete_cluster_inside_prow_job() {
585+
# Inside a real Prow job it is better to clean up at runtime
586+
# instead of leaving that to the Prow job cleanup code
587+
# because the later sometimes times out (https://github.com/kubernetes-csi/csi-release-tools/issues/24#issuecomment-554765872).
588+
if [ "$JOB_NAME" ]; then
589+
if kind get clusters | grep -q csi-prow; then
590+
run kind delete cluster --name=csi-prow || die "kind delete failed"
591+
fi
592+
unset KUBECONFIG
593+
fi
594+
}
595+
583596
# Looks for the deployment as specified by CSI_PROW_DEPLOYMENT and CSI_PROW_KUBERNETES_VERSION
584597
# in the given directory.
585598
find_deployment () {
@@ -1017,6 +1030,7 @@ main () {
10171030
fi
10181031
fi
10191032
fi
1033+
delete_cluster_inside_prow_job
10201034
fi
10211035

10221036
if tests_need_alpha_cluster && [ "${CSI_PROW_E2E_ALPHA_GATES}" ]; then
@@ -1047,6 +1061,7 @@ main () {
10471061
fi
10481062
fi
10491063
fi
1064+
delete_cluster_inside_prow_job
10501065
fi
10511066
fi
10521067

0 commit comments

Comments
 (0)