Merge pull request #134740 from hoskeri/untolerated-taint-generic

Do not log untolerated taint in pod status updates.
This commit is contained in:
Kubernetes Prow Robot
2025-10-30 02:22:03 -07:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -115,8 +115,8 @@ func (pl *TaintToleration) Filter(ctx context.Context, state fwk.CycleState, pod
return nil
}
errReason := fmt.Sprintf("node(s) had untolerated taint {%s: %s}", taint.Key, taint.Value)
return fwk.NewStatus(fwk.UnschedulableAndUnresolvable, errReason)
klog.FromContext(ctx).V(4).Info("node had untolerated taints", "node", klog.KObj(node), "pod", klog.KObj(pod), "untoleratedTaint", taint)
return fwk.NewStatus(fwk.UnschedulableAndUnresolvable, "node(s) had untolerated taint(s)")
}
// preScoreState computed at PreScore and used at Score.

View File

@@ -283,7 +283,7 @@ func TestTaintTolerationFilter(t *testing.T) {
pod: podWithTolerations("pod1", []v1.Toleration{}),
node: nodeWithTaints("nodeA", []v1.Taint{{Key: "dedicated", Value: "user1", Effect: "NoSchedule"}}),
wantStatus: fwk.NewStatus(fwk.UnschedulableAndUnresolvable,
"node(s) had untolerated taint {dedicated: user1}"),
"node(s) had untolerated taint(s)"),
},
{
name: "A pod which can be scheduled on a dedicated node assigned to user1 with effect NoSchedule",
@@ -295,7 +295,7 @@ func TestTaintTolerationFilter(t *testing.T) {
pod: podWithTolerations("pod1", []v1.Toleration{{Key: "dedicated", Operator: "Equal", Value: "user2", Effect: "NoSchedule"}}),
node: nodeWithTaints("nodeA", []v1.Taint{{Key: "dedicated", Value: "user1", Effect: "NoSchedule"}}),
wantStatus: fwk.NewStatus(fwk.UnschedulableAndUnresolvable,
"node(s) had untolerated taint {dedicated: user1}"),
"node(s) had untolerated taint(s)"),
},
{
name: "A pod can be scheduled onto the node, with a toleration uses operator Exists that tolerates the taints on the node",
@@ -319,7 +319,7 @@ func TestTaintTolerationFilter(t *testing.T) {
pod: podWithTolerations("pod1", []v1.Toleration{{Key: "foo", Operator: "Equal", Value: "bar", Effect: "PreferNoSchedule"}}),
node: nodeWithTaints("nodeA", []v1.Taint{{Key: "foo", Value: "bar", Effect: "NoSchedule"}}),
wantStatus: fwk.NewStatus(fwk.UnschedulableAndUnresolvable,
"node(s) had untolerated taint {foo: bar}"),
"node(s) had untolerated taint(s)"),
},
{
name: "The pod has a toleration that keys and values match the taint on the node, the effect of toleration is empty, " +