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

@@ -601,7 +601,7 @@ func (r RealPodControl) DeletePod(namespace string, podID string, object runtime
if err != nil {
return fmt.Errorf("object does not have ObjectMeta, %v", err)
}
klog.V(2).Infof("Controller %v deleting pod %v/%v", accessor.GetName(), namespace, podID)
klog.V(2).InfoS("Deleting pod", "controller", accessor.GetName(), "pod", klog.KRef(namespace, podID))
if err := r.KubeClient.CoreV1().Pods(namespace).Delete(context.TODO(), podID, metav1.DeleteOptions{}); err != nil {
if apierrors.IsNotFound(err) {
klog.V(4).Infof("pod %v/%v has already been deleted.", namespace, podID)