mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #109119 from Huang-Wei/shorten-taint-msg
compact scheduling failure msg for taint/toleration mismatch
This commit is contained in:
commit
bfaeca817c
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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, " +
|
||||
|
Loading…
Reference in New Issue
Block a user