From d94f3cf534a0302417f4ec034a2f9625ad7bb4c6 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Wed, 27 Mar 2019 11:52:50 -0400 Subject: [PATCH 1/2] UPSTREAM: <824>: openshift: Set the resync interval to 10m, instead of the default 10h (#824) --- cmd/manager/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 1ffccaba6943..c7c066d6ce41 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -19,6 +19,7 @@ package main import ( "flag" "log" + "time" "github.com/openshift/cluster-api/pkg/apis" "github.com/openshift/cluster-api/pkg/controller" @@ -41,7 +42,10 @@ func main() { } // Create a new Cmd to provide shared dependencies and start components - mgr, err := manager.New(cfg, manager.Options{}) + syncPeriod := 10 * time.Minute + mgr, err := manager.New(cfg, manager.Options{ + SyncPeriod: &syncPeriod, + }) if err != nil { log.Fatal(err) } From 95b91c520e2744c35bb94926e785f5e3e84c3f61 Mon Sep 17 00:00:00 2001 From: "Vikas Choudhary (vikasc)" Date: Thu, 25 Apr 2019 01:28:46 +0530 Subject: [PATCH 2/2] UPSTREAM: <914>: openshift: Add support for passing namespace cmdline flag to the manager (#914) --- cmd/manager/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index c7c066d6ce41..251e23f6760b 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -33,8 +33,14 @@ import ( func main() { flag.Set("logtostderr", "true") klog.InitFlags(nil) - flag.Parse() + watchNamespace := flag.String("namespace", "", + "Namespace that the controller watches to reconcile cluster-api objects. If unspecified, the controller watches for cluster-api objects across all namespaces.") + flag.Parse() + if *watchNamespace != "" { + log.Printf("Watching cluster-api objects only in namespace %q for reconciliation.", *watchNamespace) + } + log.Printf("Registering Components.") // Get a config to talk to the apiserver cfg, err := config.GetConfig() if err != nil { @@ -45,6 +51,7 @@ func main() { syncPeriod := 10 * time.Minute mgr, err := manager.New(cfg, manager.Options{ SyncPeriod: &syncPeriod, + Namespace: *watchNamespace, }) if err != nil { log.Fatal(err)