From 23e6ea699ebd2d6b88dd81454aea527dbc3a77ec Mon Sep 17 00:00:00 2001 From: Sally O'Malley Date: Thu, 13 Jun 2019 16:36:06 -0400 Subject: [PATCH] Modify klog Warning 'The resourceVersion for the provided watch is too old' to Info. This warning comes from Reflector watchHandler, from the apiserver error that indicates a watch was restarted. This happens when etcd drops the connection and resources are relisted. This informs the user that the watchers are operating properly, so should be logged as Info rather than Warning. Kubernetes-commit: a953d1542c06456c6fe97121abd99acd352545df --- tools/cache/reflector.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 2daa44ba..2ca263c9 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -299,7 +299,12 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { if err := r.watchHandler(w, &resourceVersion, resyncerrc, stopCh); err != nil { if err != errorStopRequested { - klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedType, err) + switch { + case apierrs.IsResourceExpired(err): + klog.V(4).Infof("%s: watch of %v ended with: %v", r.name, r.expectedType, err) + default: + klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedType, err) + } } return nil }