Merge pull request #64697 from sttts/sttts-fuzzer-no-empty-label-keys

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apimachinery: do not fuzz ObjectMeta.{Labels/Annotation} with empty keys

Fixes flaking `TestReplicationControllerConversion`.
pull/8/head
Kubernetes Submit Queue 2018-06-04 10:53:57 -07:00 committed by GitHub
commit 16c5804482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -200,9 +200,13 @@ func v1FuzzerFuncs(codecs runtimeserializer.CodecFactory) []interface{} {
if len(j.Labels) == 0 {
j.Labels = nil
} else {
delete(j.Labels, "")
}
if len(j.Annotations) == 0 {
j.Annotations = nil
} else {
delete(j.Annotations, "")
}
if len(j.OwnerReferences) == 0 {
j.OwnerReferences = nil