Watch all namespaces by default

When nothing is configured, watch all namespaces by default. This
makes it easier to get started.

It also makes configuring to watch all namespaces less akward
(currently you have to set the WATCH_NAMESPACE environment variable
to the empty string to configure the operator to watch all namespaces.
This commit is contained in:
Simon Barendse
2021-05-14 14:09:33 +02:00
parent 9dabac4a55
commit 859c9e3462
2 changed files with 3 additions and 7 deletions

View File

@@ -83,11 +83,7 @@ func main() {
printVersion()
namespace, err := k8sutil.GetWatchNamespace()
if err != nil {
log.Error(err, "Failed to get watch namespace")
os.Exit(1)
}
namespace := os.Getenv(k8sutil.WatchNamespaceEnvVar)
// Get a config to talk to the apiserver
cfg, err := config.GetConfig()