Skip to content

Commit 34b2cf7

Browse files
committed
Add initialization logs to watchcache
1 parent 0a1e589 commit 34b2cf7

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
@@ -400,6 +400,7 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
400400
c.watchCache.SetOnReplace(func() {
401401
successfulList = true
402402
c.ready.set(true)
403+
klog.V(1).Infof("cacher (%v): initialized", c.objectType.String())
403404
})
404405
defer func() {
405406
if successfulList {
@@ -413,7 +414,7 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) {
413414
// Also note that startCaching is called in a loop, so there's no need
414415
// to have another loop here.
415416
if err := c.reflector.ListAndWatch(stopChannel); err != nil {
416-
klog.Errorf("unexpected ListAndWatch error: %v", err)
417+
klog.Errorf("cacher (%v): unexpected ListAndWatch error: %v; reinitializing...", c.objectType.String(), err)
417418
}
418419
}
419420

0 commit comments

Comments
 (0)