Skip to content

Commit

Permalink
Fixed test case
Browse files Browse the repository at this point in the history
Signed-off-by: ajaychoudhary-hotstar <[email protected]>
  • Loading branch information
ajaychoudhary-hotstar authored and kflynn committed Dec 5, 2024
1 parent ab7b539 commit f8829ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/entrypoint/endpoint_routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,12 @@ func makeEndpointSlice(namespace, name, serviceName string, endpoint []kates.End
func makeSliceEndpoint(args ...interface{}) ([]kates.Endpoint, []kates.EndpointSlicePort, error) {
var endpoints []kates.Endpoint
var ports []kates.EndpointSlicePort
portName := ""
var currentPortName string

for _, arg := range args {
switch v := arg.(type) {
case int:
portName := currentPortName
ports = append(ports, kates.EndpointSlicePort{Name: &portName, Port: int32Ptr(int32(v)), Protocol: protocolPtr(kates.ProtocolTCP)})
case string:
IP := net.ParseIP(v)
Expand All @@ -335,7 +336,7 @@ func makeSliceEndpoint(args ...interface{}) ([]kates.Endpoint, []kates.EndpointS
},
})
} else {
portName = v // Assume it's a port name if not an IP address
currentPortName = v // Assume it's a port name if not an IP address
}
default:
return nil, nil, fmt.Errorf("unrecognized type: %T", v)
Expand Down

0 comments on commit f8829ee

Please sign in to comment.