From 34b2cf7d2e1c09e10d97ec83e413c41ea7364d80 Mon Sep 17 00:00:00 2001 From: wojtekt Date: Thu, 18 Jun 2020 13:55:23 +0200 Subject: [PATCH] Add initialization logs to watchcache --- staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go index 1c5f47a64a9..7245437e631 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go @@ -400,6 +400,7 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) { c.watchCache.SetOnReplace(func() { successfulList = true c.ready.set(true) + klog.V(1).Infof("cacher (%v): initialized", c.objectType.String()) }) defer func() { if successfulList { @@ -413,7 +414,7 @@ func (c *Cacher) startCaching(stopChannel <-chan struct{}) { // Also note that startCaching is called in a loop, so there's no need // to have another loop here. if err := c.reflector.ListAndWatch(stopChannel); err != nil { - klog.Errorf("unexpected ListAndWatch error: %v", err) + klog.Errorf("cacher (%v): unexpected ListAndWatch error: %v; reinitializing...", c.objectType.String(), err) } }