Merge pull request #98593 from chymy/scheduler-structured-logs-0130

migrate pkg/scheduler/framework/plugins/volume to structured logs
This commit is contained in:
Kubernetes Prow Robot 2021-02-22 18:48:03 -08:00 committed by GitHub
commit 4225e1f1cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -254,13 +254,13 @@ func (pl *VolumeBinding) PreBind(ctx context.Context, cs *framework.CycleState,
if !ok { if !ok {
return framework.AsStatus(fmt.Errorf("no pod volumes found for node %q", nodeName)) return framework.AsStatus(fmt.Errorf("no pod volumes found for node %q", nodeName))
} }
klog.V(5).Infof("Trying to bind volumes for pod \"%v/%v\"", pod.Namespace, pod.Name) klog.V(5).InfoS("Trying to bind volumes for pod", "pod", klog.KObj(pod))
err = pl.Binder.BindPodVolumes(pod, podVolumes) err = pl.Binder.BindPodVolumes(pod, podVolumes)
if err != nil { if err != nil {
klog.V(1).Infof("Failed to bind volumes for pod \"%v/%v\": %v", pod.Namespace, pod.Name, err) klog.V(1).InfoS("Failed to bind volumes for pod", "pod", klog.KObj(pod), "err", err)
return framework.AsStatus(err) return framework.AsStatus(err)
} }
klog.V(5).Infof("Success binding volumes for pod \"%v/%v\"", pod.Namespace, pod.Name) klog.V(5).InfoS("Success binding volumes for pod", "pod", klog.KObj(pod))
return nil return nil
} }

View File

@ -158,7 +158,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod *
nodeV, _ := nodeConstraints[k] nodeV, _ := nodeConstraints[k]
volumeVSet, err := volumehelpers.LabelZonesToSet(v) volumeVSet, err := volumehelpers.LabelZonesToSet(v)
if err != nil { if err != nil {
klog.Warningf("Failed to parse label for %q: %q. Ignoring the label. err=%v. ", k, v, err) klog.InfoS("Failed to parse label, ignoring the label", "label", fmt.Sprintf("%s:%s", k, v), "err", err)
continue continue
} }