From d1f6a93338d150c35a85c6af1c6dd767776db0dd Mon Sep 17 00:00:00 2001 From: michaelkot97 Date: Tue, 7 Jun 2022 13:20:08 +0300 Subject: [PATCH] Validate MultiClusterHub is deleted before continuing Signed-off-by: michaelkot97 --- uninstall.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uninstall.sh b/uninstall.sh index 4f5a34be5..d209cadde 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -53,6 +53,12 @@ kubectl delete -k multiclusterhub/ -n ${TARGET_NAMESPACE} echo "Sleeping for 200 seconds to allow resources to finalize ..." sleep 200 +kubectl get multiclusterhub >/dev/null 2>&1 +if [ $? -ne 1 ]; then + echo "ERROR: MultiClusterHub was not deleted! Make sure to remove resource dependencies" + exit 1 +fi + kubectl delete -k multicluster-hub-operator/ -n ${TARGET_NAMESPACE} ./multicluster-hub-operator/uninstall.sh