Skip to content

Commit

Permalink
fix(NSC): handle endpoint slice ready nil
Browse files Browse the repository at this point in the history
In some cases it is possible for Endpoint.Conditions.Ready to be nil
during the early stages of initialization. When this happens it causes
kube-router to segfault. This fix tests for nil before testing for
Ready.
  • Loading branch information
aauren committed Dec 8, 2023
1 parent 0f3714b commit aebaa48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controllers/proxy/network_services_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ func (nsc *NetworkServicesController) buildEndpointSliceInfo() endpointSliceInfo
// so here we need to limit our endpoints to only the ones that are ready. In the future, we could consider
// changing this to .Serving which continues to include pods that are in Terminating state. For now we keep
// it the same.
if !*ep.Conditions.Ready {
if ep.Conditions.Ready == nil || !*ep.Conditions.Ready {
continue
}

Expand Down

0 comments on commit aebaa48

Please sign in to comment.