Skip to content

Commit a047c7f

Browse files
authored
fix: instance cleanup without scope (#1836)
1 parent 14a468d commit a047c7f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/actions/check.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ func CheckForSanity(client container.Client, filter types.Filter, rollingRestart
3939
// will stop and remove all but the most recently started container. This behaviour can be bypassed
4040
// if a scope UID is defined.
4141
func CheckForMultipleWatchtowerInstances(client container.Client, cleanup bool, scope string) error {
42-
containers, err := client.ListContainers(filters.FilterByScope(scope, filters.WatchtowerContainersFilter))
42+
filter := filters.WatchtowerContainersFilter
43+
if scope != "" {
44+
filter = filters.FilterByScope(scope, filter)
45+
}
46+
containers, err := client.ListContainers(filter)
4347

4448
if err != nil {
4549
return err

0 commit comments

Comments
 (0)