From d326c1b2e6d8b4faefc07ccbab40faac4ca79395 Mon Sep 17 00:00:00 2001 From: Anca Iordache Date: Wed, 12 May 2021 16:01:17 +0200 Subject: [PATCH] Add more event types to trigger fstrim Signed-off-by: Anca Iordache --- pkg/trim-after-delete/main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/trim-after-delete/main.go b/pkg/trim-after-delete/main.go index bbcb154d0..459d44ca4 100644 --- a/pkg/trim-after-delete/main.go +++ b/pkg/trim-after-delete/main.go @@ -144,6 +144,18 @@ RECONNECT: } else if event.Action == "destroy" && event.Type == "volume" { log.Printf("A volume has been removed: will run the action at least once more") action.AtLeastOnceMore() + } else if event.Action == "prune" && event.Type == "image" { + log.Printf("Dangling images have been removed: will run the action at least once more") + action.AtLeastOnceMore() + } else if event.Action == "prune" && event.Type == "container" { + log.Printf("Stopped containers have been removed: will run the action at least once more") + action.AtLeastOnceMore() + } else if event.Action == "prune" && event.Type == "volume" { + log.Printf("Unused volumes have been removed: will run the action at least once more") + action.AtLeastOnceMore() + } else if event.Action == "prune" && event.Type == "builder" { + log.Printf("Dangling build cache has been removed: will run the action at least once more") + action.AtLeastOnceMore() } } }