"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "staging/src/k8s.io/legacy-cloud-providers/gce/gce_loadbalancer_internal.go" between
kubernetes-1.18.14.tar.gz and kubernetes-1.18.15.tar.gz

About: Kubernetes is a platform for automating deployment, scaling, and operations of application containers across clusters of hosts (written in "Go"). 1.18.x series.

gce_loadbalancer_internal.go  (kubernetes-1.18.14):gce_loadbalancer_internal.go  (kubernetes-1.18.15)
skipping to change at line 161 skipping to change at line 161
var addrMgr *addressManager var addrMgr *addressManager
// If the network is not a legacy network, use the address manager // If the network is not a legacy network, use the address manager
if !g.IsLegacyNetwork() { if !g.IsLegacyNetwork() {
addrMgr = newAddressManager(g, nm.String(), g.Region(), subnetwor kURL, loadBalancerName, ipToUse, cloud.SchemeInternal) addrMgr = newAddressManager(g, nm.String(), g.Region(), subnetwor kURL, loadBalancerName, ipToUse, cloud.SchemeInternal)
ipToUse, err = addrMgr.HoldAddress() ipToUse, err = addrMgr.HoldAddress()
if err != nil { if err != nil {
return nil, err return nil, err
} }
klog.V(2).Infof("ensureInternalLoadBalancer(%v): reserved IP %q f or the forwarding rule", loadBalancerName, ipToUse) klog.V(2).Infof("ensureInternalLoadBalancer(%v): reserved IP %q f or the forwarding rule", loadBalancerName, ipToUse)
defer func() {
// Release the address if all resources were created succ
essfully, or if we error out.
if err := addrMgr.ReleaseAddress(); err != nil {
klog.Errorf("ensureInternalLoadBalancer: failed t
o release address reservation, possibly causing an orphan: %v", err)
}
}()
} }
// Ensure firewall rules if necessary // Ensure firewall rules if necessary
if err = g.ensureInternalFirewalls(loadBalancerName, ipToUse, clusterID, nm, svc, strconv.Itoa(int(hcPort)), sharedHealthCheck, nodes); err != nil { if err = g.ensureInternalFirewalls(loadBalancerName, ipToUse, clusterID, nm, svc, strconv.Itoa(int(hcPort)), sharedHealthCheck, nodes); err != nil {
return nil, err return nil, err
} }
bsDescription := makeBackendServiceDescription(nm, sharedBackend) bsDescription := makeBackendServiceDescription(nm, sharedBackend)
err = g.ensureInternalBackendService(backendServiceName, bsDescription, s vc.Spec.SessionAffinity, scheme, protocol, igLinks, hc.SelfLink) err = g.ensureInternalBackendService(backendServiceName, bsDescription, s vc.Spec.SessionAffinity, scheme, protocol, igLinks, hc.SelfLink)
if err != nil { if err != nil {
skipping to change at line 200 skipping to change at line 206
} }
if err := g.ensureInternalForwardingRule(existingFwdRule, newFRC); err != nil { if err := g.ensureInternalForwardingRule(existingFwdRule, newFRC); err != nil {
return nil, err return nil, err
} }
// Delete the previous internal load balancer resources if necessary // Delete the previous internal load balancer resources if necessary
if existingBackendService != nil { if existingBackendService != nil {
g.clearPreviousInternalResources(svc, loadBalancerName, existingB ackendService, backendServiceName, hcName) g.clearPreviousInternalResources(svc, loadBalancerName, existingB ackendService, backendServiceName, hcName)
} }
if addrMgr != nil {
// Now that the controller knows the forwarding rule exists, we c
an release the address.
if err := addrMgr.ReleaseAddress(); err != nil {
klog.Errorf("ensureInternalLoadBalancer: failed to releas
e address reservation, possibly causing an orphan: %v", err)
}
}
// Get the most recent forwarding rule for the address. // Get the most recent forwarding rule for the address.
updatedFwdRule, err := g.GetRegionForwardingRule(loadBalancerName, g.regi on) updatedFwdRule, err := g.GetRegionForwardingRule(loadBalancerName, g.regi on)
if err != nil { if err != nil {
return nil, err return nil, err
} }
status := &v1.LoadBalancerStatus{} status := &v1.LoadBalancerStatus{}
status.Ingress = []v1.LoadBalancerIngress{{IP: updatedFwdRule.IPAddress}} status.Ingress = []v1.LoadBalancerIngress{{IP: updatedFwdRule.IPAddress}}
return status, nil return status, nil
} }
 End of changes. 2 change blocks. 
9 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)