From 00f8b3aa3506a4e40e0a43d76b82acd1edbed0fd Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Mon, 7 Aug 2023 12:56:32 +0200 Subject: [PATCH] client-go: log proper 'caches populated' message, with type and source and only once Signed-off-by: Dr. Stefan Schimanski Kubernetes-commit: a1809ffae377f3abbae12b137073ca4c473743cd --- tools/cache/reflector.go | 4 +++- tools/cache/shared_informer.go | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 45eaff52..119f80ac 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -337,7 +337,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { if !apierrors.IsInvalid(err) { return err } - klog.Warning("the watch-list feature is not supported by the server, falling back to the previous LIST/WATCH semantic") + klog.Warning("The watch-list feature is not supported by the server, falling back to the previous LIST/WATCH semantics") fallbackToList = true // Ensure that we won't accidentally pass some garbage down the watch. w = nil @@ -351,6 +351,8 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { } } + klog.V(2).Infof("Caches populated for %v from %s", r.typeDescription, r.name) + resyncerrc := make(chan error, 1) cancelCh := make(chan struct{}) defer close(cancelCh) diff --git a/tools/cache/shared_informer.go b/tools/cache/shared_informer.go index be8694dd..b3f37431 100644 --- a/tools/cache/shared_informer.go +++ b/tools/cache/shared_informer.go @@ -334,11 +334,9 @@ func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool }, stopCh) if err != nil { - klog.V(2).Infof("stop requested") return false } - klog.V(4).Infof("caches populated") return true }