Skip to content

Commit 92cb72b

Browse files
committed
chore: check kind cluster exists before deleting it
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
1 parent 548df5c commit 92cb72b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

kind-gpu-sim.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,12 @@ EOF
278278
}
279279

280280
function delete_cluster() {
281-
kind delete cluster --name "${CLUSTER_NAME}"
281+
if kind get clusters | grep -qx "${CLUSTER_NAME}"; then
282+
echo "Deleting kind cluster '${CLUSTER_NAME}'..."
283+
kind delete cluster --name "${CLUSTER_NAME}"
284+
else
285+
echo "Kind cluster '${CLUSTER_NAME}' does not exist. Skipping delete."
286+
fi
282287
}
283288

284289
function delete_registry() {

0 commit comments

Comments
 (0)