Skip to content

Commit 6b32089

Browse files
committed
fix: artifacts and kind cluster not getting cleaned up properly
We do not properly clean up the kind cluster if the upgrade_cluster_components step fails. Fix is to properly trap the exit code and clean up if the upgrade fails Signed-off-by: Michael Aspinwall <[email protected]>
1 parent c6d2a67 commit 6b32089

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

experiment/compatibility-versions/e2e-k8s-compatibility-versions.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,12 @@ main() {
391391
UPGRADE_SCRIPT="${UPGRADE_SCRIPT:-${PWD}/../test-infra/experiment/compatibility-versions/kind-upgrade.sh}"
392392
echo "Upgrading cluster with ${UPGRADE_SCRIPT}"
393393

394-
upgrade_cluster_components
394+
upgrade_cluster_components || res=$?
395+
# If upgrade fails, we shouldn't run tests but should still clean up.
396+
if [[ "$res" -ne 0 ]]; then
397+
cleanup
398+
exit $res
399+
fi
395400

396401
# Clone the previous versions Kubernetes release branch
397402
# TODO(aaron-prindle) extend the branches to test from n-1 -> n-1..3 as more k8s releases are done that support compatibility versions

0 commit comments

Comments
 (0)