Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ajaychoudhary-hotstar/emissary in…
Browse files Browse the repository at this point in the history
…to ci-5798

Signed-off-by: Flynn <[email protected]>
  • Loading branch information
kflynn committed Nov 26, 2024
2 parents 7534cc6 + ab3572f commit 1ee3d7a
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 1ee3d7a

Please sign in to comment.