tests: adding coverage for kube endpoint provider
* tests: adding coverage testing for kube endpoint providers
Testing ~79.8% coverage
Added small change to pass/expect empty non-nil array instead of nil array
in client.go
* Fixing some names
@@ -70,7 +70,7 @@ func (c *Client) GetID() string {
// ListEndpointsForService retrieves the list of IP addresses for the given service
func (c Client) ListEndpointsForService(svc service.MeshService) []endpoint.Endpoint {
log.Info().Msgf("[%s] Getting Endpoints for service %s on Kubernetes", c.providerIdent, svc)
- var endpoints []endpoint.Endpoint
+ var endpoints []endpoint.Endpoint = []endpoint.Endpoint{}
endpointsInterface, exist, err := c.caches.Endpoints.GetByKey(svc.String())
if err != nil {
log.Error().Err(err).Msgf("[%s] Error fetching Kubernetes Endpoints from cache", c.providerIdent)
