Skip to content

Commit 967fa25

Browse files
authored
Uninstall confirmation (#313)
1 parent f985cf9 commit 967fa25

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

cortex.sh

+16-1
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,21 @@ function prompt_for_telemetry() {
385385
fi
386386
}
387387

388+
function confirm_for_uninstall() {
389+
while true
390+
do
391+
echo
392+
read -p "Are you sure you want to uninstall Cortex? Your cluster will be spun down and all resources will be deleted. [Y/n] " -n 1 -r
393+
echo
394+
if [[ $REPLY =~ ^[Yy]$ ]]; then
395+
break
396+
elif [[ $REPLY =~ ^[Nn]$ ]]; then
397+
exit 0
398+
fi
399+
echo "Unexpected value: $REPLY. Please enter \"Y\" or \"n\""
400+
done
401+
}
402+
388403
############
389404
### HELP ###
390405
############
@@ -448,7 +463,7 @@ elif [ "$arg1" = "uninstall" ]; then
448463
show_help
449464
exit 1
450465
elif [ "$arg2" = "" ]; then
451-
uninstall_eks
466+
confirm_for_uninstall && uninstall_eks
452467
elif [ "$arg2" = "cli" ]; then
453468
uninstall_cli
454469
elif [ "$arg2" = "" ]; then

0 commit comments

Comments
 (0)