Skip to content

Commit 4037166

Browse files
authored
Merge pull request kubernetes#92265 from wojtek-t/cacher_logs
Add initialization logs to watchcache
2 parents b197633 + 34b2cf7 commit 4037166

File tree

1 file changed

+2
-1
lines changed
  • staging/src/k8s.io/apiserver/pkg/storage/cacher

1 file changed

+2
-1
lines changed

staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
399399
c.watchCache.SetOnReplace(func() {
400400
successfulList = true
401401
c.ready.set(true)
402+
klog.V(1).Infof("cacher (%v): initialized", c.objectType.String())
402403
})
403404
defer func() {
404405
if successfulList {
@@ -412,7 +413,7 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
412413
// Also note that startCaching is called in a loop, so there's no need
413414
// to have another loop here.
414415
if err := c.reflector.ListAndWatch(stopChannel); err != nil {
415-
klog.Errorf("unexpected ListAndWatch error: %v", err)
416+
klog.Errorf("cacher (%v): unexpected ListAndWatch error: %v; reinitializing...", c.objectType.String(), err)
416417
}
417418
}
418419

0 commit comments

Comments
 (0)