Updating EndpointSlice controllers to support NodeName field

This commit is contained in:
Rob Scott
2020-11-10 17:50:39 -08:00
parent e9573eef4c
commit d985438772
6 changed files with 120 additions and 1 deletions

View File

@@ -87,6 +87,10 @@ func podToEndpoint(pod *corev1.Pod, node *corev1.Node, service *corev1.Service,
ep.Conditions.Terminating = &terminating
}
if pod.Spec.NodeName != "" && utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceNodeName) {
ep.NodeName = &pod.Spec.NodeName
}
if endpointutil.ShouldSetHostname(pod, service) {
ep.Hostname = &pod.Spec.Hostname
}