Fix volume destination filtering in removal process
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -180,8 +180,8 @@ remove_additionals() {
|
|||||||
# get volume destinations
|
# get volume destinations
|
||||||
DESTINATIONS=""
|
DESTINATIONS=""
|
||||||
VOLUMES=""
|
VOLUMES=""
|
||||||
DESTINATIONS=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("VOLUMES")) | .VOLUMES[] | select(.SHARED != "true") | .DEST] | unique[]')
|
DESTINATIONS=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("VOLUMES")) | .VOLUMES[] | select(.SHARED != "true") | .SOURCE] | unique[]' | grep $NAME)
|
||||||
for DESTINATION in $(echo $DESTINATIONS | grep $NAME); do
|
for DESTINATION in $(echo $DESTINATIONS); do
|
||||||
if [ -d "$DESTINATION" ] || [ -f "$DESTINATION" ]; then
|
if [ -d "$DESTINATION" ] || [ -f "$DESTINATION" ]; then
|
||||||
rm -rf $DESTINATION
|
rm -rf $DESTINATION
|
||||||
debug "deleted directory or file: $DESTINATION"
|
debug "deleted directory or file: $DESTINATION"
|
||||||
|
|||||||
Reference in New Issue
Block a user