Migrate to log calls to klog.InfoS and klog.ErroS for pkg/controller

This commit is contained in:
tahsinrahman
2020-05-29 20:27:22 +08:00
parent 4f5ce1fa88
commit 78318c7a26
7 changed files with 27 additions and 18 deletions

View File

@@ -337,8 +337,13 @@ func (e *EndpointController) handleErr(err error, key interface{}) {
return
}
ns, name, keyErr := cache.SplitMetaNamespaceKey(key.(string))
if keyErr != nil {
klog.ErrorS(err, "Failed to split meta namespace cache key", "key", key)
}
if e.queue.NumRequeues(key) < maxRetries {
klog.V(2).Infof("Error syncing endpoints for service %q, retrying. Error: %v", key, err)
klog.V(2).InfoS("Error syncing endpoints, retrying", "service", klog.KRef(ns, name), "err", err)
e.queue.AddRateLimited(key)
return
}