@@ -18,6 +18,7 @@ package manager
18
18
19
19
import (
20
20
"fmt"
21
+ "time"
21
22
22
23
"k8s.io/apimachinery/pkg/api/meta"
23
24
"k8s.io/apimachinery/pkg/runtime"
@@ -75,6 +76,14 @@ type Options struct {
75
76
// MapperProvider provides the rest mapper used to map go types to Kubernetes APIs
76
77
MapperProvider func (c * rest.Config ) (meta.RESTMapper , error )
77
78
79
+ // SyncPeriod determines the minimum frequency at which watched objects are
80
+ // reconciled. A lower period will correct entropy more quickly but reduce
81
+ // responsiveness to change. Choose a low value if reconciles are fast and/or
82
+ // there are few objects to reconcile. Choose a high value if reconciles are
83
+ // slow and/or there are many object to reconcile. Defaults to 10 hours if
84
+ // unset.
85
+ SyncPeriod * time.Duration
86
+
78
87
// Dependency injection for testing
79
88
newCache func (config * rest.Config , opts cache.Options ) (cache.Cache , error )
80
89
newClient func (config * rest.Config , options client.Options ) (client.Client , error )
@@ -120,7 +129,7 @@ func New(config *rest.Config, options Options) (Manager, error) {
120
129
}
121
130
122
131
// Create the cache for the cached read client and registering informers
123
- cache , err := options .newCache (config , cache.Options {Scheme : options .Scheme , Mapper : mapper })
132
+ cache , err := options .newCache (config , cache.Options {Scheme : options .Scheme , Mapper : mapper , Resync : options . SyncPeriod })
124
133
if err != nil {
125
134
return nil , err
126
135
0 commit comments