-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathstop.sh
42 lines (36 loc) · 982 Bytes
/
stop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#/bin/bash
set +x
set +e
###########################################################################
# Usage: bash -f ./stop.sh
# Supported Options -
# --kind-cluster-name=<Kind Cluster Name> (default INTEGRATION_TEST_CLUSTER)
###########################################################################
# All Supported Arguments
ARGUMENT_LIST=(
"kind-cluster-name"
)
# Read Arguments
opts=$(getopt \
--longoptions "$(printf "%s:," "${ARGUMENT_LIST[@]}")" \
--name "$(basename "$0")" \
--options "" \
-- "$@"
)
# Assign Values from Arguments
eval set --$opts
while [[ $# -gt 0 ]]; do
case "$1" in
--kind-cluster-name)
CLUSTER_NAME=$2
shift 2
;;
*)
break
;;
esac
done
# Assign Deafults
CLUSTER_NAME=${CLUSTER_NAME:-"INTEGRATION_TEST_CLUSTER"}
echo $(date -u) "[INFO] Deleting a KIND cluster ${CLUSTER_NAME}"
./kind delete cluster --name ${CLUSTER_NAME}