FirstEndpointSliceIP returns the IP of the first Address in the EndpointSlice
(endpoint *discoveryv1.EndpointSlice)
| 29 | |
| 30 | // FirstEndpointSliceIP returns the IP of the first Address in the EndpointSlice |
| 31 | func FirstEndpointSliceIP(endpoint *discoveryv1.EndpointSlice) string { |
| 32 | if endpoint == nil { |
| 33 | return "" |
| 34 | } |
| 35 | if len(endpoint.Endpoints) == 0 || len(endpoint.Endpoints[0].Addresses) == 0 { |
| 36 | return "" |
| 37 | } |
| 38 | return endpoint.Endpoints[0].Addresses[0] |
| 39 | } |
| 40 | |
| 41 | // GetEndpointSliceByServiceName returns the EndpointSlice for a given service name in a given namespace |
| 42 | func GetEndpointSliceByServiceName( |
no outgoing calls