trim-after-delete: handle containers and volumes as well as images#3539
trim-after-delete: handle containers and volumes as well as images#3539rn merged 2 commits intolinuxkit:masterfrom
Conversation
358054e to
f8b9934
Compare
| log.Printf("An image has been removed: will run the action at least once more") | ||
| action.AtLeastOnceMore() | ||
| } else if event.Action == "destroy" && event.Type == "container" { | ||
| log.Printf("A container has been removed: will run the action at least once more") | ||
| action.AtLeastOnceMore() | ||
| } else if event.Action == "destroy" && event.Type == "volume" { | ||
| log.Printf("A volume has been removed: will run the action at least once more") |
There was a problem hiding this comment.
Wondering if this will become very noisy (perhaps not a problem, just curious if every even should be logged here, or logging should also be delayed (or only in debug mode)
There was a problem hiding this comment.
I've not noticed whether it's a problem in practice or not... but I've not been looking. I'll keep an eye out!
|
(also opened moby/moby#41259 to allow checking for "prune" events, which include pruning the BuildKit build cache) |
|
LGTM |
b684ed8 to
830d70d
Compare
|
Thanks I built the package can you update the examples to use |
We already run the command after an image delete but - a container delete - a volume delete will also free space on the filesystem. Co-authored-by: Sebastiaan van Stijn <[email protected]> Signed-off-by: David Scott <[email protected]>
Signed-off-by: David Scott <[email protected]>
55e670b to
1866957
Compare
|
I pushed a separate commit with the example update. Per @thaJeztah 's request I squashed his update into my original patch, hope this is ok! |
rn
left a comment
There was a problem hiding this comment.
Somehow this was never merged. merging now
|
Thanks! |
- What I did
Extended
trim-after-deleteto run the command after a container destroy and volume destroy.- How I did it
We already watch for events, so it's a simple matter to handle the additional container and volume events.
- How to verify it
I run
and then
docker rma container. I see the following output:If I
docker image rman image I see the following output:If I
docker volume rma volume I see the following output:- Description for the changelog
trim-after-delete: run the command also after container destroy and volume destroy.- A picture of a cute animal (not mandatory but encouraged)