Last active
February 8, 2024 17:38
-
-
Save ghelobytes/18af6df89036ecbe1af3647853e86d9e to your computer and use it in GitHub Desktop.
Add prompt to confirm correct cluster but doesn't prompt when CI=true (GH actions)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete-namespace: check-cluster | |
kubectl delete namespace sandbox | |
check-cluster: | |
@if [ -z "$(CI)" ]; then current_context=$(shell kubectl config current-context); \ | |
echo "The current context is `tput bold`$$current_context`tput sgr0`."; \ | |
read -p "Is this the correct context? (y/n): " answer; if [ "$$answer" != "y" ]; \ | |
then echo "Aborted."; exit 1; fi; echo "Proceeding..."; \ | |
fi | |
# $ make delete-namespace | |
# The current context is docker-desktop. | |
# Is this the correct context? (y/n): y | |
# Proceeding... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment