Skip to content

Commit 70b6129

Browse files
authored
Add confirmation prompt to kctf cluster stop for GKE (#374)
Authored-by: Federico Scrinzi <[email protected]>
1 parent 8cf050b commit 70b6129

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dist/bin/kctf-cluster

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,11 @@ function kctf_cluster_start {
721721
}
722722

723723
function kctf_cluster_stop_gce {
724+
read -p "Do you really want to delete the GKE cluster? If you are sure type the cluster name (${CLUSTER_NAME}): "
725+
if [[ ! "${REPLY}" = "${CLUSTER_NAME}" ]]
726+
then
727+
return 1
728+
fi
724729
_kctf_log "deleting all challenges so that load balancers etc can be cleaned up"
725730
CHALLENGES=$("${KCTF_BIN}/kubectl" get challenge --all-namespaces -o=jsonpath='{range .items[*]}{@.metadata.namespace}{"/"}{@.metadata.name}{" "}{end}')
726731
if [[ ! -z "${CHALLENGES}" ]]; then

0 commit comments

Comments
 (0)