Skip to content

Commit a138771

Browse files
committed
fix: port name should always set to endpointPortName
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 6ca4414 commit a138771

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/utils/endpoints.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ func ConvertEndpointsToEndpointSlice(ep *corev1.Endpoints) []discoveryv1.Endpoin
7272
epPort := discoveryv1.EndpointPort{
7373
Port: &p.Port,
7474
Protocol: &p.Protocol,
75-
}
76-
if p.Name != "" {
77-
epPort.Name = &p.Name
75+
Name: &p.Name,
7876
}
7977
ports = append(ports, epPort)
8078
}

0 commit comments

Comments
 (0)