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

@@ -481,8 +481,13 @@ func (dc *DeploymentController) 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 dc.queue.NumRequeues(key) < maxRetries {
klog.V(2).Infof("Error syncing deployment %v: %v", key, err)
klog.V(2).InfoS("Error syncing deployment", "deployment", klog.KRef(ns, name), "err", err)
dc.queue.AddRateLimited(key)
return
}