Skip to content

Commit

Permalink
Add confirmation prompt to kctf cluster stop for GKE (#374)
Browse files Browse the repository at this point in the history
Authored-by: Federico Scrinzi <[email protected]>
  • Loading branch information
volpino authored Jun 16, 2022
1 parent 8cf050b commit 70b6129
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dist/bin/kctf-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70b6129

Please sign in to comment.