Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix app deletion be stuck #112

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions templates/argo-cd/delete-apps-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ spec:
app_list=$(./argocd app list -l $FILTER --output name | grep -v operator | grep -v crds)
if [[ $? -eq 0 && -n $app_list ]]; then
echo -e "[1st phase] Deleting apps:\n$app_list"
echo "$app_list" | xargs ./argocd app delete --cascade -y
echo "$app_list" | xargs ./argocd app terminate-op || true
echo "$app_list" | xargs ./argocd app delete --cascade --propagation-policy background -y
ktkfree marked this conversation as resolved.
Show resolved Hide resolved

until [ $(./argocd app list -l $FILTER --output name | grep -v operator | grep -v crds | wc -l) == 0 ]
do
Expand All @@ -59,7 +60,8 @@ spec:
app_list=$(./argocd app list -l $FILTER --output name)
if [[ $? -eq 0 && -n $app_list ]]; then
echo -e "[2nd phase] Deleting operators:\n$app_list"
echo "$app_list" | xargs ./argocd app delete --cascade -y
echo "$app_list" | xargs ./argocd app terminate-op || true
echo "$app_list" | xargs ./argocd app delete --cascade --propagation-policy background -y

until [ $(./argocd app list -l $FILTER --output name | wc -l) == 0 ]
do
Expand Down Expand Up @@ -108,7 +110,8 @@ spec:
fi

echo "Found app '$APP'. Start deleting it.."
./argocd app delete $APP --cascade -y
./argocd app terminate-op $APP || true
./argocd app delete $APP --cascade --propagation-policy background -y

while (./argocd app list --output name | grep -E "^$APP$" )
do
Expand Down