|
|
|
@ -416,18 +416,21 @@ func (e *EndpointSlice) buildEndpointSlice(eps endpointSliceAdaptor) *targetgrou
|
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
a := net.JoinHostPort(pe.pod.Status.PodIP, strconv.FormatUint(uint64(cport.ContainerPort), 10)) |
|
|
|
|
ports := strconv.FormatUint(uint64(cport.ContainerPort), 10) |
|
|
|
|
|
|
|
|
|
target := model.LabelSet{ |
|
|
|
|
model.AddressLabel: lv(a), |
|
|
|
|
podContainerNameLabel: lv(c.Name), |
|
|
|
|
podContainerImageLabel: lv(c.Image), |
|
|
|
|
podContainerPortNameLabel: lv(cport.Name), |
|
|
|
|
podContainerPortNumberLabel: lv(ports), |
|
|
|
|
podContainerPortProtocolLabel: lv(string(cport.Protocol)), |
|
|
|
|
// PodIP can be empty when a pod is starting or has been evicted.
|
|
|
|
|
if len(pe.pod.Status.PodIP) != 0 { |
|
|
|
|
a := net.JoinHostPort(pe.pod.Status.PodIP, strconv.FormatUint(uint64(cport.ContainerPort), 10)) |
|
|
|
|
ports := strconv.FormatUint(uint64(cport.ContainerPort), 10) |
|
|
|
|
|
|
|
|
|
target := model.LabelSet{ |
|
|
|
|
model.AddressLabel: lv(a), |
|
|
|
|
podContainerNameLabel: lv(c.Name), |
|
|
|
|
podContainerImageLabel: lv(c.Image), |
|
|
|
|
podContainerPortNameLabel: lv(cport.Name), |
|
|
|
|
podContainerPortNumberLabel: lv(ports), |
|
|
|
|
podContainerPortProtocolLabel: lv(string(cport.Protocol)), |
|
|
|
|
} |
|
|
|
|
tg.Targets = append(tg.Targets, target.Merge(podLabels(pe.pod))) |
|
|
|
|
} |
|
|
|
|
tg.Targets = append(tg.Targets, target.Merge(podLabels(pe.pod))) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|