diff --git a/plugin/pkg/admission/antiaffinity/admission_test.go b/plugin/pkg/admission/antiaffinity/admission_test.go index bded0340b61..3073d6d81c6 100644 --- a/plugin/pkg/admission/antiaffinity/admission_test.go +++ b/plugin/pkg/admission/antiaffinity/admission_test.go @@ -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