Skip to content

Commit

Permalink
Support WATCH_NAMESPACE=* to watch all namespaces (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimdickinson authored Oct 16, 2020
1 parent 71806ea commit f856de1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions operator/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ func printVersion() {
}

func main() {

// workaround for cases where the empty string can't come through
// environment variable values - we'll use star to mean all namespaces
{
env := "WATCH_NAMESPACE"
v, ok := os.LookupEnv(env)
if ok && v == "*" {
os.Setenv(env, "")
}
}

// Add the zap logger flag set to the CLI. The flag set must
// be added before calling pflag.Parse().
pflag.CommandLine.AddFlagSet(zap.FlagSet())
Expand Down

0 comments on commit f856de1

Please sign in to comment.