Skip to content

Commit

Permalink
bugfix: check app status using exact matching
Browse files Browse the repository at this point in the history
  • Loading branch information
robertchoi80 committed Mar 25, 2022
1 parent d42cbae commit dbb4ca3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/argo-cd/delete-apps-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ spec:
--password $ARGO_PASSWORD
# Pre-check: validate if the app exists
if ! (./argocd app list | grep $APP); then
if ! (./argocd app list --output name | grep -E "^$APP$"); then
echo "No such app: $APP. Skipping app removal.."
exit 1
fi
echo "Found app '$APP'. Start deleting it.."
./argocd app delete $APP --cascade -y
while (./argocd app list | grep $APP )
while (./argocd app list --output name | grep -E "^$APP$" )
do
echo "Waiting 20 secs for the app to be deleted.."
sleep 20
Expand Down

0 comments on commit dbb4ca3

Please sign in to comment.