Add unit test to ensure no error thrown

This commit is contained in:
Harry Zhang 2016-06-21 22:23:37 -04:00
parent 080b49276e
commit 49fe9d1b41

View File

@ -200,6 +200,16 @@ func TestInterPodAffinityAdmission(t *testing.T) {
},
errorExpected: true,
},
{
affinity: map[string]string{
api.AffinityAnnotationKey: `
{"podAntiAffinity": {
"thisIsAInvalidAffinity": [{}
}}`,
},
// however, we should not got error here
errorExpected: false,
},
}
for _, test := range tests {
pod.ObjectMeta.Annotations = test.affinity