mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #104822 from justinsb/less_cmp_2
Don't perform expensive go-cmp/cmp comparisons if unneeded
This commit is contained in:
		@@ -202,8 +202,10 @@ func (g *Cloud) ensureInternalLoadBalancer(clusterName, clusterID string, svc *v
 | 
			
		||||
		// Delete existing forwarding rule before making changes to the backend service. For example - changing protocol
 | 
			
		||||
		// of backend service without first deleting forwarding rule will throw an error since the linked forwarding
 | 
			
		||||
		// rule would show the old protocol.
 | 
			
		||||
		frDiff := cmp.Diff(existingFwdRule, newFwdRule)
 | 
			
		||||
		klog.V(2).Infof("ensureInternalLoadBalancer(%v): forwarding rule changed - Existing - %+v\n, New - %+v\n, Diff(-existing, +new) - %s\n. Deleting existing forwarding rule.", loadBalancerName, existingFwdRule, newFwdRule, frDiff)
 | 
			
		||||
		if klog.V(2).Enabled() {
 | 
			
		||||
			frDiff := cmp.Diff(existingFwdRule, newFwdRule)
 | 
			
		||||
			klog.V(2).Infof("ensureInternalLoadBalancer(%v): forwarding rule changed - Existing - %+v\n, New - %+v\n, Diff(-existing, +new) - %s\n. Deleting existing forwarding rule.", loadBalancerName, existingFwdRule, newFwdRule, frDiff)
 | 
			
		||||
		}
 | 
			
		||||
		if err = ignoreNotFound(g.DeleteRegionForwardingRule(loadBalancerName, g.region)); err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user