diff --git a/cmd/provider/main.go b/cmd/provider/main.go index b01c0848..e4517080 100644 --- a/cmd/provider/main.go +++ b/cmd/provider/main.go @@ -27,6 +27,7 @@ import ( "github.com/alecthomas/kingpin/v2" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/log/zap" xpcontroller "github.com/crossplane/crossplane-runtime/v2/pkg/controller" @@ -47,6 +48,7 @@ func main() { leaderElection = app.Flag("leader-election", "Use leader election for the controller manager.").Short('l').Default("false").Envar("LEADER_ELECTION").Bool() maxReconcileRate = app.Flag("max-reconcile-rate", "The global maximum rate per second at which resources may checked for drift from the desired state.").Default("10").Int() enableManagementPolicies = app.Flag("enable-management-policies", "Enable/disable support for Management Policies.").Default("true").Envar("ENABLE_MANAGEMENT_POLICIES").Bool() + cacheSyncTimeout = app.Flag("cache-sync-timeout", "Timeout for syncing caches.").Default("2m").Duration() ) kingpin.MustParse(app.Parse(os.Args[1:])) @@ -70,6 +72,9 @@ func main() { Cache: cache.Options{ SyncPeriod: syncPeriod, }, + Controller: config.Controller{ + CacheSyncTimeout: *cacheSyncTimeout, + }, }) kingpin.FatalIfError(err, "Cannot create controller manager") kingpin.FatalIfError(apis.AddToScheme(mgr.GetScheme()), "Cannot add SQL APIs to scheme")