From a047c7f9ff11813f930f6998863fa1b8a015985c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Sat, 11 Nov 2023 17:12:06 +0100 Subject: [PATCH] fix: instance cleanup without scope (#1836) --- internal/actions/check.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/actions/check.go b/internal/actions/check.go index 3bfcf7d..77a2266 100644 --- a/internal/actions/check.go +++ b/internal/actions/check.go @@ -39,7 +39,11 @@ func CheckForSanity(client container.Client, filter types.Filter, rollingRestart // will stop and remove all but the most recently started container. This behaviour can be bypassed // if a scope UID is defined. func CheckForMultipleWatchtowerInstances(client container.Client, cleanup bool, scope string) error { - containers, err := client.ListContainers(filters.FilterByScope(scope, filters.WatchtowerContainersFilter)) + filter := filters.WatchtowerContainersFilter + if scope != "" { + filter = filters.FilterByScope(scope, filter) + } + containers, err := client.ListContainers(filter) if err != nil { return err