MCPcopy Index your code
hub / github.com/cortexlabs/cortex / getLoadBalancerURL

Function getLoadBalancerURL

pkg/operator/operator/k8s.go:38–53  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

36}
37
38func 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
55func APIEndpoint(api *spec.API) (string, error) {
56 var err error

Callers 2

APILoadBalancerURLFunction · 0.85
LoadBalancerURLFunction · 0.85

Calls 3

GetServiceMethod · 0.80

Tested by

no test coverage detected