(name string)
| 36 | } |
| 37 | |
| 38 | func getLoadBalancerURL(name string) (string, error) { |
| 39 | service, err := config.K8sIstio.GetService(name) |
| 40 | if err != nil { |
| 41 | return "", err |
| 42 | } |
| 43 | if service == nil { |
| 44 | return "", ErrorCortexInstallationBroken() |
| 45 | } |
| 46 | if len(service.Status.LoadBalancer.Ingress) == 0 { |
| 47 | return "", ErrorLoadBalancerInitializing() |
| 48 | } |
| 49 | if service.Status.LoadBalancer.Ingress[0].Hostname != "" { |
| 50 | return "http://" + service.Status.LoadBalancer.Ingress[0].Hostname, nil |
| 51 | } |
| 52 | return "http://" + service.Status.LoadBalancer.Ingress[0].IP, nil |
| 53 | } |
| 54 | |
| 55 | func APIEndpoint(api *spec.API) (string, error) { |
| 56 | var err error |
no test coverage detected