bugfix for PodToleratesNodeTaints

This commit is contained in:
mqliang
2017-01-09 18:16:43 +08:00
parent de59ede6b2
commit d473646855
2 changed files with 26 additions and 6 deletions

View File

@@ -3060,6 +3060,31 @@ func TestPodToleratesTaints(t *testing.T) {
test: "The pod has a toleration that key and value don't match the taint on the node, " +
"but the effect of taint on node is PreferNochedule. Pod can be scheduled onto the node",
},
{
pod: &v1.Pod{
ObjectMeta: v1.ObjectMeta{
Name: "pod2",
},
Spec: v1.PodSpec{
Containers: []v1.Container{{Image: "pod2:V1"}},
},
},
node: v1.Node{
ObjectMeta: v1.ObjectMeta{
Annotations: map[string]string{
v1.TaintsAnnotationKey: `
[{
"key": "dedicated",
"value": "user1",
"effect": "PreferNoSchedule"
}]`,
},
},
},
fits: true,
test: "The pod has no toleration, " +
"but the effect of taint on node is PreferNochedule. Pod can be scheduled onto the node",
},
}
expectedFailureReasons := []algorithm.PredicateFailureReason{ErrTaintsTolerationsNotMatch}