mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-12-23 00:54:26 +01:00
dockcross: Ensure deletion error are ignored
This commit follows up on 2e71db2
(dockcross: Ignore deletion error
when running in unprivileged LXC container) by hiding the message
only when (a) the command output matches the expected error message
and (b) is executed on CircleCI.
Doing so will avoid adding "noise" to log of service like CircleCI
that are effectively running docker in unprivileged LXC container.
See #50
This commit is contained in:
parent
0926d89d99
commit
c0fe1e2313
@ -205,10 +205,17 @@ docker run $TTY_ARGS --name $CONTAINER_NAME \
|
|||||||
$FINAL_IMAGE "$@"
|
$FINAL_IMAGE "$@"
|
||||||
run_exit_code=$?
|
run_exit_code=$?
|
||||||
|
|
||||||
# Deleting the container while ignoring error is required because of
|
# Attempt to delete container
|
||||||
# https://circleci.com/docs/docker-btrfs-error/.
|
rm_output=$(docker rm -f $CONTAINER_NAME 2>&1)
|
||||||
# See issue dockcross/dockcross#50 for more details.
|
rm_exit_code=$?
|
||||||
docker rm -f $CONTAINER_NAME > /dev/null || true
|
if [[ $rm_exit_code != 0 ]]; then
|
||||||
|
if [[ "$CIRCLECI" == "true" ]] && [[ $rm_output == *"Driver btrfs failed to remove"* ]]; then
|
||||||
|
: # Ignore error because of https://circleci.com/docs/docker-btrfs-error/
|
||||||
|
else
|
||||||
|
echo "$rm_output"
|
||||||
|
exit $rm_exit_code
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
exit $run_exit_code
|
exit $run_exit_code
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user