func isBackendAddressPoolApplicable()

in pkg/providers/loadbalancer/loadbalancer.go [162:186]


func isBackendAddressPoolApplicable(backendPool *armnetwork.BackendAddressPool, _ int) bool {
	if backendPool.Properties == nil || backendPool.Name == nil {
		return false // shouldn't ever happen
	}

	name := *backendPool.Name
	// Ignore well-known named ipv6 pools for now
	if strings.EqualFold(name, SLBOutboundBackendPoolNameIPv6) || strings.EqualFold(name, SLBInboundBackendPoolNameIPv6) {
		return false
	}

	// Ignore IP-based pools, which are a thing in NodeIP mode. We don't need to assign these pools.
	// See isIPBasedBackendPool in RP.
	for _, backendAddress := range backendPool.Properties.LoadBalancerBackendAddresses {
		if backendAddress.Properties == nil || backendAddress.Properties.IPAddress == nil {
			continue
		}

		if *backendAddress.Properties.IPAddress != "" {
			return false
		}
	}

	return true
}