Merge pull request #60880 from wojtek-t/fix_pod_to_selectable_fields

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>.

Avoid reallocating of map in PodToSelectableFields

Ref #60589
pull/6/head
Kubernetes Submit Queue 2018-03-07 05:07:20 -08:00 committed by GitHub
commit 5364f7beb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ func PodToSelectableFields(pod *api.Pod) fields.Set {
// amount of allocations needed to create the fields.Set. If you add any
// field here or the number of object-meta related fields changes, this should
// be adjusted.
podSpecificFieldsSet := make(fields.Set, 7)
podSpecificFieldsSet := make(fields.Set, 8)
podSpecificFieldsSet["spec.nodeName"] = pod.Spec.NodeName
podSpecificFieldsSet["spec.restartPolicy"] = string(pod.Spec.RestartPolicy)
podSpecificFieldsSet["spec.schedulerName"] = string(pod.Spec.SchedulerName)