Commit e3e9de60 authored by Marek Grabowski's avatar Marek Grabowski

Fix panic in ControllerManager when GCE external loadbalancer healthcheck is nil

parent 9aef242a
...@@ -514,8 +514,9 @@ func (gce *GCECloud) createTargetPool(svc *v1.Service, name, serviceName, ipAddr ...@@ -514,8 +514,9 @@ func (gce *GCECloud) createTargetPool(svc *v1.Service, name, serviceName, ipAddr
return err return err
} }
var err error var err error
hcRequestPath, hcPort := hc.RequestPath, hc.Port
if hc, err = gce.ensureHttpHealthCheck(hc.Name, hc.RequestPath, int32(hc.Port)); err != nil || hc == nil { if hc, err = gce.ensureHttpHealthCheck(hc.Name, hc.RequestPath, int32(hc.Port)); err != nil || hc == nil {
return fmt.Errorf("Failed to ensure health check for %v port %d path %v: %v", name, hc.Port, hc.RequestPath, err) return fmt.Errorf("Failed to ensure health check for %v port %d path %v: %v", name, hcPort, hcRequestPath, err)
} }
hcLinks = append(hcLinks, hc.SelfLink) hcLinks = append(hcLinks, hc.SelfLink)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment