mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
feat(filters): Add a flag/env to explicitly exclude containers by name (#1784)
This commit is contained in:
parent
9180e9558e
commit
623f4e67fb
5 changed files with 118 additions and 19 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -85,6 +86,13 @@ func RegisterSystemFlags(rootCmd *cobra.Command) {
|
|||
envBool("WATCHTOWER_LABEL_ENABLE"),
|
||||
"Watch containers where the com.centurylinklabs.watchtower.enable label is true")
|
||||
|
||||
flags.StringSliceP(
|
||||
"disable-containers",
|
||||
"x",
|
||||
// Due to issue spf13/viper#380, can't use viper.GetStringSlice:
|
||||
regexp.MustCompile("[, ]+").Split(envString("WATCHTOWER_DISABLE_CONTAINERS"), -1),
|
||||
"Comma-separated list of containers to explicitly exclude from watching.")
|
||||
|
||||
flags.StringP(
|
||||
"log-format",
|
||||
"l",
|
||||
|
@ -197,8 +205,8 @@ func RegisterSystemFlags(rootCmd *cobra.Command) {
|
|||
"",
|
||||
false,
|
||||
"Do health check and exit")
|
||||
|
||||
flags.BoolP(
|
||||
|
||||
flags.BoolP(
|
||||
"label-take-precedence",
|
||||
"",
|
||||
envBool("WATCHTOWER_LABEL_TAKE_PRECEDENCE"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue