Avoid reallocating of map in PodToSelectableFields

This commit is contained in:
wojtekt 2018-03-07 12:26:02 +01:00
parent 891b471064
commit 6786d6691a

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)