From b1fa272d3b4f7e589cb718da47caacb244d0dec8 Mon Sep 17 00:00:00 2001 From: KM ANJU <95232459+KMAnju-2021@users.noreply.github.com> Date: Wed, 29 Nov 2023 00:05:11 +0530 Subject: [PATCH] Improve Kind cleanup in CI (#5738) * Make sure that Antrea docker networks are deleted when garbage collecting clusters * Modify the Kind builder script for Jenkins CI to use `kind-setup.sh destroy` Signed-off-by: KMAnju-2021 --- ci/jenkins/jobs/macros.yaml | 2 +- ci/kind/kind-setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/jenkins/jobs/macros.yaml b/ci/jenkins/jobs/macros.yaml index 4fa4fc13753..8b92ec07b81 100644 --- a/ci/jenkins/jobs/macros.yaml +++ b/ci/jenkins/jobs/macros.yaml @@ -246,7 +246,7 @@ ./ci/jenkins/test.sh --testcase '{conformance_type}' --registry ${{DOCKER_REGISTRY}} --kubeconfig ${{PWD}}/.kube/config --testbed-type "kind" --kind-cluster-name "${{JOB_NAME}}-${{BUILD_NUMBER}}" return_code=$? set -ex - kind delete cluster --name "${{JOB_NAME}}-${{BUILD_NUMBER}}" + ./ci/kind/kind-setup.sh destroy "${{JOB_NAME}}-${{BUILD_NUMBER}}" exit $return_code - builder: diff --git a/ci/kind/kind-setup.sh b/ci/kind/kind-setup.sh index 06a9028bb24..11296ce1fa9 100755 --- a/ci/kind/kind-setup.sh +++ b/ci/kind/kind-setup.sh @@ -383,8 +383,8 @@ function destroy { clean_kind else kind delete cluster --name $CLUSTER_NAME - delete_networks fi + delete_networks } function printUnixTimestamp {