-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore containers #45
Conversation
Codecov Report
@@ Coverage Diff @@
## master #45 +/- ##
========================================
+ Coverage 96.42% 100% +3.57%
========================================
Files 7 7
Lines 140 145 +5
========================================
+ Hits 135 145 +10
+ Misses 5 0 -5
Continue to review full report at Codecov.
|
@circa10a How do you think we should handle a situation in which a user does the following: $ ouroboros --monitor test1 test2 --ignore test1 Should we throw an error and refuse to do anything, or should one flag take precedence over the other? |
I think an error should be thrown for a couple of reasons:
The only issue I have with the reasons above is I would hate for the application not to start because of user error, but I think it's more vital not to update a potentially import container... |
So what if we do this:
|
I like it 😄 |
TIL intersection! Ready to merge? |
Nope still WIP |
@circa10a Gonna update the integration test and then it'll be ready to merge |
@circa10a It's ready when you are my d00d |
$ docker pull busybox:1.28
1.28: Pulling from library/busybox
07a152489297: Pull complete
Digest: sha256:141c253bc4c3fd0a201d32dc1f493bcf3fff003b6df416dea4f41046e0f37d47
Status: Downloaded newer image for busybox:1.28
$ docker run -d --name bb busybox:1.28 tail -f /dev/null
b44a2839e91141468c223115f7bf8e2f1f00afde22b56a49a8731ced6933c173
$ docker run -d --name ignore busybox:1.28 tail -f /dev/null
70dd2426b27b12c5eebba8b3cbabab26236204f7791429c079cc395ee08491f3
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
70dd2426b27b busybox:1.28 "tail -f /dev/null" 2 seconds ago Up 2 seconds ignore
b44a2839e911 busybox:1.28 "tail -f /dev/null" 25 seconds ago Up 24 seconds bb
$ ouroboros --interval 5 --monitor bb ignore --ignore ignore --runonce --cleanup
[INFO] 2018-11-03 16:11:27 Running job Every 5 seconds do main(args=Namespace(cleanup=True, ignore=['ignore'], interval=5, loglevel='info', monitor=['bb', 'ignore'], run_once=True, url='unix://var/run/docker.sock'), api_client=<docker.api.client.APIClient object at 0x100e8b320>) (last run: [never], next run: 2018-11-03 16:11:27)
[INFO] 2018-11-03 16:11:27 Ignoring container(s): ignore
[INFO] 2018-11-03 16:11:29 bb will be updated
[INFO] 2018-11-03 16:11:40 Removing image: busybox:1.28
[CRITICAL] 2018-11-03 16:11:40 Could not clean up image: busybox:1.28, reason:
409 Client Error: Conflict ("conflict: unable to delete 8c811b4aec35 (cannot be forced) - image is being used by running container 70dd2426b27b")
[INFO] 2018-11-03 16:11:40 1 container(s) updated
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a462e84a78d9 busybox:latest "tail -f /dev/null" 23 seconds ago Up 21 seconds bb
70dd2426b27b busybox:1.28 "tail -f /dev/null" 2 minutes ago Up 2 minutes ignore |
Adds the ability to ignore select running containers.
Closes #35