returnnil,fmt.Errorf("failed to create target pool %s: %v",loadBalancerName,err)
}
iflen(hosts)<=maxTargetPoolCreateInstances{
glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created target pool",loadBalancerName,serviceName)
glog.Infof("EnsureLoadBalancer(%v(%v)): created target pool",loadBalancerName,serviceName)
}else{
glog.V(4).Infof("EnsureLoadBalancer(%v(%v)): created initial target pool (now updating with %d hosts)",loadBalancerName,serviceName,len(hosts)-maxTargetPoolCreateInstances)
glog.Infof("EnsureLoadBalancer(%v(%v)): created initial target pool (now updating with %d hosts)",loadBalancerName,serviceName,len(hosts)-maxTargetPoolCreateInstances)
glog.Infof("LoadBalancer ip for forwarding rule %v was expected to be %v, but was actually %v",fwd.Name,fwd.IPAddress,loadBalancerIP)
returntrue,true,fwd.IPAddress,nil
}
portRange,err:=loadBalancerPortRange(ports)
iferr!=nil{
returnfalse,false,"",err
// Err on the side of caution in case of errors. Caller should notice the error and retry.
// We never want to end up recreating resources because gce api flaked.
returntrue,false,"",err
}
ifportRange!=fwd.PortRange{
glog.Infof("LoadBalancer port range for forwarding rule %v was expected to be %v, but was actually %v",fwd.Name,fwd.PortRange,portRange)
returntrue,true,fwd.IPAddress,nil
}
// The service controller verified all the protocols match on the ports, just check the first one
ifstring(ports[0].Protocol)!=fwd.IPProtocol{
glog.Infof("LoadBalancer protocol for forwarding rule %v was expected to be %v, but was actually %v",fwd.Name,fwd.IPProtocol,string(ports[0].Protocol))
returntrue,true,fwd.IPAddress,nil
}
...
...
@@ -811,9 +828,20 @@ func (gce *GCECloud) targetPoolNeedsUpdate(name, region string, affinityType api