Skip to content

Commit

Permalink
fix: support EndpointSlice with empty conditions {} (#2408)
Browse files Browse the repository at this point in the history
support EndpointSlice with empty conditions `{}`

Signed-off-by: Zuo Zongyuan <[email protected]>
  • Loading branch information
eternalphane authored Jan 6, 2024
1 parent fb67037 commit eb26959
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/gatewayapi/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,8 @@ func getIREndpointsFromEndpointSlice(endpointSlice *discoveryv1.EndpointSlice, p
// and if endpoint is Ready
if *endpointPort.Name == portName &&
*endpointPort.Protocol == portProtocol &&
*endpoint.Conditions.Ready {
// Unknown state (nil) should be interpreted as Ready, see https://pkg.go.dev/k8s.io/api/discovery/v1#EndpointConditions
(endpoint.Conditions.Ready == nil || *endpoint.Conditions.Ready) {
for _, address := range endpoint.Addresses {
ep := ir.NewDestEndpoint(
address,
Expand Down

0 comments on commit eb26959

Please sign in to comment.