Merge pull request #109119 from Huang-Wei/shorten-taint-msg

compact scheduling failure msg for taint/toleration mismatch
This commit is contained in:
Kubernetes Prow Robot 2022-04-01 13:50:10 -07:00 committed by GitHub
commit bfaeca817c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -76,8 +76,7 @@ func (pl *TaintToleration) Filter(ctx context.Context, state *framework.CycleSta
return nil
}
errReason := fmt.Sprintf("node(s) had taint {%s: %s}, that the pod didn't tolerate",
taint.Key, taint.Value)
errReason := fmt.Sprintf("node(s) had untolerated taint {%s: %s}", taint.Key, taint.Value)
return framework.NewStatus(framework.UnschedulableAndUnresolvable, errReason)
}

View File

@ -271,7 +271,7 @@ func TestTaintTolerationFilter(t *testing.T) {
pod: podWithTolerations("pod1", []v1.Toleration{}),
node: nodeWithTaints("nodeA", []v1.Taint{{Key: "dedicated", Value: "user1", Effect: "NoSchedule"}}),
wantStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable,
"node(s) had taint {dedicated: user1}, that the pod didn't tolerate"),
"node(s) had untolerated taint {dedicated: user1}"),
},
{
name: "A pod which can be scheduled on a dedicated node assigned to user1 with effect NoSchedule",
@ -283,7 +283,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: framework.NewStatus(framework.UnschedulableAndUnresolvable,
"node(s) had taint {dedicated: user1}, that the pod didn't tolerate"),
"node(s) had untolerated taint {dedicated: user1}"),
},
{
name: "A pod can be scheduled onto the node, with a toleration uses operator Exists that tolerates the taints on the node",
@ -307,7 +307,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: framework.NewStatus(framework.UnschedulableAndUnresolvable,
"node(s) had taint {foo: bar}, that the pod didn't tolerate"),
"node(s) had untolerated taint {foo: bar}"),
},
{
name: "The pod has a toleration that keys and values match the taint on the node, the effect of toleration is empty, " +