implemented enableLabel by a Filter

This commit is contained in:
Fabrizio Steiner 2018-03-02 17:22:42 +01:00
parent f5fb4ed6a2
commit 026a04b59b
6 changed files with 79 additions and 46 deletions

View file

@ -6,14 +6,12 @@ import (
"github.com/v2tec/watchtower/container"
)
func watchtowerContainersFilter(c container.Container) bool { return c.IsWatchtower() }
// CheckPrereqs will ensure that there are not multiple instances of the
// watchtower running simultaneously. If multiple watchtower containers are
// detected, this function will stop and remove all but the most recently
// started container.
func CheckPrereqs(client container.Client, cleanup bool) error {
containers, err := client.ListContainers(watchtowerContainersFilter)
containers, err := client.ListContainers(container.WatchtowerContainersFilter)
if err != nil {
return err
}