Skip to content

Commit

Permalink
Use ClientUncachedObjects name consistently
Browse files Browse the repository at this point in the history
Align naming on (client)UncachedObjects for ClusterCacheTrackerOptions, ClusterCacheTracker and NewDelegatingClientInput
  • Loading branch information
enxebre committed Jun 8, 2021
1 parent 786375f commit b82cdab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/remote/cluster_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ type ClusterCacheTrackerOptions struct {
// Defaults to a no-op logger if it's not set.
Log logr.Logger

// ClientDisableCacheFor instructs the Client to never cache the following objects,
// ClientUncachedObjects instructs the Client to never cache the following objects,
// it'll instead query the API server directly.
// Defaults to never caching ConfigMap and Secret if not set.
ClientDisableCacheFor []client.Object
ClientUncachedObjects []client.Object
}

func setDefaultOptions(opts *ClusterCacheTrackerOptions) {
if opts.Log == nil {
opts.Log = log.NullLogger{}
}

if len(opts.ClientDisableCacheFor) == 0 {
opts.ClientDisableCacheFor = []client.Object{
if len(opts.ClientUncachedObjects) == 0 {
opts.ClientUncachedObjects = []client.Object{
&corev1.ConfigMap{},
&corev1.Secret{},
}
Expand All @@ -93,7 +93,7 @@ func NewClusterCacheTracker(manager ctrl.Manager, options ClusterCacheTrackerOpt

return &ClusterCacheTracker{
log: options.Log,
clientUncachedObjects: options.ClientDisableCacheFor,
clientUncachedObjects: options.ClientUncachedObjects,
client: manager.GetClient(),
scheme: manager.GetScheme(),
clusterAccessors: make(map[client.ObjectKey]*clusterAccessor),
Expand Down

0 comments on commit b82cdab

Please sign in to comment.