Skip to content

Commit

Permalink
Fix TestGetEndpointSlicesBySubselectedPods_GetsEndpointsOnNilValues
Browse files Browse the repository at this point in the history
Signed-off-by: Eng Zer Jun <[email protected]>
  • Loading branch information
Juneezee committed Jan 15, 2025
1 parent cbc32f6 commit a5e6810
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/k8s/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@ func getEndpointsFromEndpointSlicesForSubselectedPods(targetPort int32, pods []*
}
}
}
return maps.Keys(endpointSet)
return slices.Collect(maps.Keys(endpointSet))
}

return makePodEndpoints(pods, filterReadyEndpointsFrom(selectEndpointSlicesForPort(targetPort, svcEndpointSlices)))
Expand Down
4 changes: 2 additions & 2 deletions internal/k8s/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ func TestGetEndpointSlicesBySubselectedPods_GetsEndpointsOnNilValues(t *testing.
{
desc: "no endpoints selected on nil endpoint port",
targetPort: 8080,
want: []podEndpoint{},
want: nil,
pods: []*api_v1.Pod{
{
ObjectMeta: meta_v1.ObjectMeta{
Expand Down Expand Up @@ -1267,7 +1267,7 @@ func TestGetEndpointSlicesBySubselectedPods_GetsEndpointsOnNilValues(t *testing.
{
desc: "no endpoints selected on nil endpoint condition",
targetPort: 8080,
want: []podEndpoint{},
want: nil,
pods: []*api_v1.Pod{
{
ObjectMeta: meta_v1.ObjectMeta{
Expand Down

0 comments on commit a5e6810

Please sign in to comment.