Log whether watch cache is used for particular resources

Kubernetes-commit: ce3bf7ae944d4d9255537617b340d5da4efc288f
This commit is contained in:
Mike Spreitzer 2022-03-30 23:16:02 -04:00 committed by Kubernetes Publisher
parent c983abad33
commit 60facb736d
1 changed files with 2 additions and 0 deletions

View File

@ -270,8 +270,10 @@ func (f *SimpleRestOptionsFactory) GetRESTOptions(resource schema.GroupResource)
klog.Warningf("Dropping watch-cache-size for %v - watchCache size is now dynamic", resource)
}
if ok && size <= 0 {
klog.V(3).InfoS("Not using watch cache", "resource", resource)
ret.Decorator = generic.UndecoratedStorage
} else {
klog.V(3).InfoS("Using watch cache", "resource", resource)
ret.Decorator = genericregistry.StorageWithCacher()
}
}