mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Add unit test to ensure no error thrown
This commit is contained in:
parent
080b49276e
commit
49fe9d1b41
@ -200,6 +200,16 @@ func TestInterPodAffinityAdmission(t *testing.T) {
|
|||||||
},
|
},
|
||||||
errorExpected: true,
|
errorExpected: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
affinity: map[string]string{
|
||||||
|
api.AffinityAnnotationKey: `
|
||||||
|
{"podAntiAffinity": {
|
||||||
|
"thisIsAInvalidAffinity": [{}
|
||||||
|
}}`,
|
||||||
|
},
|
||||||
|
// however, we should not got error here
|
||||||
|
errorExpected: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
pod.ObjectMeta.Annotations = test.affinity
|
pod.ObjectMeta.Annotations = test.affinity
|
||||||
|
Loading…
Reference in New Issue
Block a user