mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Merge pull request #110477 from halfcrazy/feat/hostnetwork-fieldsel
support fieldSelector spec.hostNetwork
This commit is contained in:
@@ -319,11 +319,17 @@ func ToSelectableFields(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, 9)
|
||||
podSpecificFieldsSet := make(fields.Set, 10)
|
||||
podSpecificFieldsSet["spec.nodeName"] = pod.Spec.NodeName
|
||||
podSpecificFieldsSet["spec.restartPolicy"] = string(pod.Spec.RestartPolicy)
|
||||
podSpecificFieldsSet["spec.schedulerName"] = string(pod.Spec.SchedulerName)
|
||||
podSpecificFieldsSet["spec.serviceAccountName"] = string(pod.Spec.ServiceAccountName)
|
||||
if pod.Spec.SecurityContext != nil {
|
||||
podSpecificFieldsSet["spec.hostNetwork"] = strconv.FormatBool(pod.Spec.SecurityContext.HostNetwork)
|
||||
} else {
|
||||
// default to false
|
||||
podSpecificFieldsSet["spec.hostNetwork"] = strconv.FormatBool(false)
|
||||
}
|
||||
podSpecificFieldsSet["status.phase"] = string(pod.Status.Phase)
|
||||
// TODO: add podIPs as a downward API value(s) with proper format
|
||||
podIP := ""
|
||||
|
||||
Reference in New Issue
Block a user