diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go b/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go index c5f0a6088ce..3b3d0f6d9a5 100644 --- a/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go +++ b/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go @@ -161,7 +161,7 @@ func (pl *InterPodAffinity) getExistingAntiAffinityCounts(pod *v1.Pod, nsLabels nodeInfo := nodes[i] node := nodeInfo.Node() if node == nil { - klog.Error("node not found") + klog.ErrorS(nil, "Node not found") return } topoMap := make(topologyToMatchedTermCount) @@ -200,7 +200,7 @@ func (pl *InterPodAffinity) getIncomingAffinityAntiAffinityCounts(podInfo *frame nodeInfo := allNodes[i] node := nodeInfo.Node() if node == nil { - klog.Error("node not found") + klog.ErrorS(nil, "Node not found") return } affinity := make(topologyToMatchedTermCount) diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go index 6d86cdc84b6..e8a75b5e186 100644 --- a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go +++ b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go @@ -226,7 +226,7 @@ func (pl *PodTopologySpread) calPreFilterState(pod *v1.Pod) (*preFilterState, er for _, n := range allNodes { node := n.Node() if node == nil { - klog.Error("node not found") + klog.ErrorS(nil, "Node not found") continue } // In accordance to design, if NodeAffinity or NodeSelector is defined, @@ -296,7 +296,7 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C tpKey := c.TopologyKey tpVal, ok := node.Labels[c.TopologyKey] if !ok { - klog.V(5).Infof("node '%s' doesn't have required label '%s'", node.Name, tpKey) + klog.V(5).InfoS("Node doesn't have required label", "node", klog.KObj(node), "label", tpKey) return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonNodeLabelNotMatch) } @@ -309,7 +309,7 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C paths, ok := s.TpKeyToCriticalPaths[tpKey] if !ok { // error which should not happen - klog.Errorf("internal error: get paths from key %q of %#v", tpKey, s.TpKeyToCriticalPaths) + klog.ErrorS(nil, "Internal error occurred while retrieving paths from topology key", "topologyKey", tpKey, "paths", s.TpKeyToCriticalPaths) continue } // judging criteria: @@ -321,7 +321,7 @@ func (pl *PodTopologySpread) Filter(ctx context.Context, cycleState *framework.C } skew := matchNum + selfMatchNum - minMatchNum if skew > c.MaxSkew { - klog.V(5).Infof("node '%s' failed spreadConstraint[%s]: MatchNum(%d) + selfMatchNum(%d) - minMatchNum(%d) > maxSkew(%d)", node.Name, tpKey, matchNum, selfMatchNum, minMatchNum, c.MaxSkew) + klog.V(5).InfoS("Node failed spreadConstraint: matchNum + selfMatchNum - minMatchNum > maxSkew", "node", klog.KObj(node), "topologyKey", tpKey, "matchNum", matchNum, "selfMatchNum", selfMatchNum, "minMatchNum", minMatchNum, "maxSkew", c.MaxSkew) return framework.NewStatus(framework.Unschedulable, ErrReasonConstraintsNotMatch) } } diff --git a/pkg/scheduler/framework/plugins/volumezone/volume_zone.go b/pkg/scheduler/framework/plugins/volumezone/volume_zone.go index 6f12b5cc6ab..fb548121d45 100644 --- a/pkg/scheduler/framework/plugins/volumezone/volume_zone.go +++ b/pkg/scheduler/framework/plugins/volumezone/volume_zone.go @@ -157,7 +157,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod * } if !volumeVSet.Has(nodeV) { - klog.V(10).Infof("Won't schedule pod %q onto node %q due to volume %q (mismatch on %q)", pod.Name, node.Name, pvName, k) + klog.V(10).InfoS("Won't schedule pod onto node due to volume (mismatch on label key)", "pod", klog.KObj(pod), "node", klog.KObj(node), "PV", klog.KRef("", pvName), "PVLabelKey", k) return framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonConflict) } }