Fix volume/secret deletion logic

- Fix escaping of quotes
- Dont delete things unless options are passed
This commit is contained in:
Luke Murphy 2021-03-04 19:21:38 +01:00
parent 7434b67c34
commit 621c8cd5c4
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

8
abra
View File

@ -1135,16 +1135,20 @@ sub_app_delete (){
prompt_confirm prompt_confirm
fi fi
if [ "$abra___volumes" = "true" ]; then
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker volume rm --force "$(docker volume ls --filter \"name=${STACK_NAME}\" --quiet)" docker volume rm --force "$(docker volume ls --filter "name=${STACK_NAME}" --quiet)"
fi
if [ "$abra___force" != "true" ] && [ "$abra___secrets" = "true" ]; then if [ "$abra___force" != "true" ] && [ "$abra___secrets" = "true" ]; then
warning "SCARY: About to remove all secrets associated with ${STACK_NAME}" warning "SCARY: About to remove all secrets associated with ${STACK_NAME}"
prompt_confirm prompt_confirm
fi fi
if [ "$abra___secrets" = "true" ]; then
# shellcheck disable=SC2086 # shellcheck disable=SC2086
docker secret rm --force "$(docker secret ls --filter \"name=${STACK_NAME}\" --quiet)" docker secret rm "$(docker secret ls --filter "name=${STACK_NAME}" --quiet)"
fi
} }
###### .. app secret insert ###### .. app secret insert