Skip to content

Commit

Permalink
Update designs/cache_options.md
Browse files Browse the repository at this point in the history
Co-authored-by: Umanga Chapagain <uchapaga@redhat.com>
  • Loading branch information
alvaroaleman and umangachapagain committed Apr 6, 2023
1 parent 7125944 commit e14a0f9
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion designs/cache_options.md
Expand Up @@ -102,6 +102,47 @@ type Options struct {
// DefaultUnsafeDisableDeepCopy is the default for UnsafeDisableDeepCopy
// for everything that doesn't specify this.
DefaultUnsafeDisableDeepCopy *bool
// DefaultTransform will be used as transform for all object types
// unless they have a more specific transform set in ByObject.
DefaultTransform toolscache.TransformFunc
// HTTPClient is the http client to use for the REST client
HTTPClient *http.Client
// Scheme is the scheme to use for mapping objects to GroupVersionKinds
Scheme *runtime.Scheme
// Mapper is the RESTMapper to use for mapping GroupVersionKinds to Resources
Mapper meta.RESTMapper
// SyncPeriod determines the minimum frequency at which watched resources are
// reconciled. A lower period will correct entropy more quickly, but reduce
// responsiveness to change if there are many watched resources. Change this
// value only if you know what you are doing. Defaults to 10 hours if unset.
// there will a 10 percent jitter between the SyncPeriod of all controllers
// so that all controllers will not send list requests simultaneously.
//
// This applies to all controllers.
//
// A period sync happens for two reasons:
// 1. To insure against a bug in the controller that causes an object to not
// be requeued, when it otherwise should be requeued.
// 2. To insure against an unknown bug in controller-runtime, or its dependencies,
// that causes an object to not be requeued, when it otherwise should be
// requeued, or to be removed from the queue, when it otherwise should not
// be removed.
//
// If you want
// 1. to insure against missed watch events, or
// 2. to poll services that cannot be watched,
// then we recommend that, instead of changing the default period, the
// controller requeue, with a constant duration `t`, whenever the controller
// is "done" with an object, and would otherwise not requeue it, i.e., we
// recommend the `Reconcile` function return `reconcile.Result{RequeueAfter: t}`,
// instead of `reconcile.Result{}`.
SyncPeriod *time.Duration
}
```

Expand Down Expand Up @@ -135,7 +176,7 @@ Options{
&corev1.ConfgMap{}: {
Namespaces: map[string]*cache.CacheSetting{
"": {}, // No selector for all namespaces...
"operator" {LabelSelector: labelSelector}, // except for the operator namespace
"operator": {LabelSelector: labelSelector}, // except for the operator namespace
},
},
},
Expand Down

0 comments on commit e14a0f9

Please sign in to comment.