Remove all app containers before removing volume
If volume location changes, we re-create the volume. However, volume can only be removed if all the containers using it are deleted. For example, the scheduler might be running a container using it.
This commit is contained in:
@@ -24,6 +24,8 @@ if [[ "${BOX_ENV}" == "test" ]]; then
|
||||
[[ "${volume_dir}" != *"./cloudron_test/"* ]] && exit 1
|
||||
fi
|
||||
|
||||
rm -rf "${volume_dir}"/*
|
||||
# mount points cannot be deleted
|
||||
# this removes hidden files
|
||||
find "${volume_dir}" -maxdepth 1 -mindepth 1 -exec rm -rf '{}' \;
|
||||
# volume could be a mount point that cannot be deleted
|
||||
rmdir "${volume_dir}" || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user