mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Avoid reallocating of map in PodToSelectableFields
This commit is contained in:
parent
891b471064
commit
6786d6691a
@ -237,7 +237,7 @@ func PodToSelectableFields(pod *api.Pod) fields.Set {
|
|||||||
// amount of allocations needed to create the fields.Set. If you add any
|
// 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
|
// field here or the number of object-meta related fields changes, this should
|
||||||
// be adjusted.
|
// be adjusted.
|
||||||
podSpecificFieldsSet := make(fields.Set, 7)
|
podSpecificFieldsSet := make(fields.Set, 8)
|
||||||
podSpecificFieldsSet["spec.nodeName"] = pod.Spec.NodeName
|
podSpecificFieldsSet["spec.nodeName"] = pod.Spec.NodeName
|
||||||
podSpecificFieldsSet["spec.restartPolicy"] = string(pod.Spec.RestartPolicy)
|
podSpecificFieldsSet["spec.restartPolicy"] = string(pod.Spec.RestartPolicy)
|
||||||
podSpecificFieldsSet["spec.schedulerName"] = string(pod.Spec.SchedulerName)
|
podSpecificFieldsSet["spec.schedulerName"] = string(pod.Spec.SchedulerName)
|
||||||
|
Loading…
Reference in New Issue
Block a user