Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Setting REMOVE_VOLUMES=1 causes docker-gc to exit with status 1 #201

Closed
makkes opened this issue Mar 26, 2019 · 4 comments · Fixed by #202
Closed

Setting REMOVE_VOLUMES=1 causes docker-gc to exit with status 1 #201

makkes opened this issue Mar 26, 2019 · 4 comments · Fixed by #202
Labels

Comments

@makkes
Copy link
Contributor

makkes commented Mar 26, 2019

Description

When setting REMOVE_VOLUMES=1 and there are no volumes found in Docker then docker-gc exits with status code 1 because of grep returning 1 when it has not found any matches.

How to reproduce

  1. Make sure that no Docker volumes exist on the system
  2. Run REMOVE_VOLUMES=1 docker-gc

What do you expect

docker-gc should exit with status code 0.

What happened instead

docker-gc exits with status code 1.

Software:

  • bash version: Any

Full backtrace

$ docker volume ls
DRIVER              VOLUME NAME
$ sudo REMOVE_VOLUMES=1 ./docker-gc
$ echo $?
1
@makkes
Copy link
Contributor Author

makkes commented Mar 26, 2019

The main problem we have with this currently is that we call docker-gc from a systemd unit and systemd then marks the unit as failed.

makkes pushed a commit to mesosphere-backup/docker-gc that referenced this issue Mar 27, 2019
makkes pushed a commit to mesosphere-backup/docker-gc that referenced this issue Apr 16, 2019
just for testing

This reverts commit 15beb94.
makkes pushed a commit to mesosphere-backup/docker-gc that referenced this issue Apr 16, 2019
@stale
Copy link

stale bot commented May 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@makkes
Copy link
Contributor Author

makkes commented Jun 3, 2019

@mattnworb @davidxia There's an open PR to fix this issue (#202) that is waiting to be merged. Would you be able to merge the PR or provide feedback, please?

davidxia added a commit that referenced this issue Jun 6, 2019
Ignore return code of `grep` (#201)
@davidxia
Copy link
Contributor

davidxia commented Jun 6, 2019

Sorry for the delay. I just merged it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants