From 70b6129fc525eddee034497e11dbb9e7ef61012a Mon Sep 17 00:00:00 2001 From: Federico Scrinzi Date: Thu, 16 Jun 2022 14:57:24 +0200 Subject: [PATCH] Add confirmation prompt to kctf cluster stop for GKE (#374) Authored-by: Federico Scrinzi --- dist/bin/kctf-cluster | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dist/bin/kctf-cluster b/dist/bin/kctf-cluster index 682d4e50..2d53d559 100755 --- a/dist/bin/kctf-cluster +++ b/dist/bin/kctf-cluster @@ -721,6 +721,11 @@ function kctf_cluster_start { } function kctf_cluster_stop_gce { + read -p "Do you really want to delete the GKE cluster? If you are sure type the cluster name (${CLUSTER_NAME}): " + if [[ ! "${REPLY}" = "${CLUSTER_NAME}" ]] + then + return 1 + fi _kctf_log "deleting all challenges so that load balancers etc can be cleaned up" CHALLENGES=$("${KCTF_BIN}/kubectl" get challenge --all-namespaces -o=jsonpath='{range .items[*]}{@.metadata.namespace}{"/"}{@.metadata.name}{" "}{end}') if [[ ! -z "${CHALLENGES}" ]]; then