mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
Add a method of enabling or disabling containers using labels
Switch command line flag from no-enable to label-enable and simplify logic Add basic documentation for the --label-enable flag
This commit is contained in:
parent
f365014b8f
commit
de2ac9341d
4 changed files with 56 additions and 5 deletions
7
main.go
7
main.go
|
@ -79,6 +79,11 @@ func main() {
|
|||
Usage: "use TLS and verify the remote",
|
||||
EnvVar: "DOCKER_TLS_VERIFY",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "label-enable",
|
||||
Usage: "watch containers where the com.centurylinklabs.watchtower.enable label is true",
|
||||
EnvVar: "WATCHTOWER_LABEL_ENABLE",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "debug",
|
||||
Usage: "enable debug mode with verbose logging",
|
||||
|
@ -146,7 +151,7 @@ func before(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
client = container.NewClient(!c.GlobalBool("no-pull"))
|
||||
client = container.NewClient(!c.GlobalBool("no-pull"), c.GlobalBool("label-enable"))
|
||||
notifier = notifications.NewNotifier(c)
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue