func (r *rangeAllocator) filterOutServiceRange(serviceCIDR *net.IPNet) {
	// Checks if service CIDR has a nonempty intersection with cluster
	// CIDR. It is the case if either clusterCIDR contains serviceCIDR with
	// clusterCIDR's Mask applied (this means that clusterCIDR contains
	// serviceCIDR) or vice versa (which means that serviceCIDR contains
	// clusterCIDR).
	for idx, cidr := range r.clusterCIDRs {
		// if they don't overlap then ignore the filtering
		if !cidr.Contains(serviceCIDR.IP.Mask(cidr.Mask)) && !serviceCIDR.Contains(cidr.IP.Mask(serviceCIDR.Mask)) {
			continue
		}

		// at this point, len(cidrSet) == len(clusterCidr)
		if err := r.cidrSets[idx].Occupy(serviceCIDR); err != nil {
			klog.Errorf("Error filtering out service cidr out cluster cidr:%v (index:%v) %v: %v", cidr, idx, serviceCIDR, err)
		}
	}
}
// Marks all CIDRs with subNetMaskSize that belongs to serviceCIDR as used across all cidrs
// so that they won't be assignable.
Marks all CIDRs with subNetMaskSize that belongs to serviceCIDR as used across all cidrs
so that they won't be assignable.
// Marks all CIDRs with subNetMaskSize that belongs to serviceCIDR as used across all cidrs // so that they won ' t be assignable .
func (r *rangeAllocator) filterOutServiceRange(serviceCIDR *net.IPNet) {
	for idx, cidr := range r.clusterCIDRs {
		if !cidr.Contains(serviceCIDR.IP.Mask(cidr.Mask)) && !serviceCIDR.Contains(cidr.IP.Mask(serviceCIDR.Mask)) {
			continue
		}
		if err := r.cidrSets[idx].Occupy(serviceCIDR); err != nil {
			klog.Errorf("Error filtering out service cidr out cluster cidr:%v (index:%v) %v: %v", cidr, idx, serviceCIDR, err)
		}
	}
}
func ( r * rangeAllocator ) filterOutServiceRange ( serviceCIDR * net . IPNet ) { for idx , cidr := range r . clusterCIDRs { if ! cidr . Contains ( serviceCIDR . IP . Mask ( cidr . Mask ) ) && ! serviceCIDR . Contains ( cidr . IP . Mask ( serviceCIDR . Mask ) ) { continue } if err := r . cidrSets [ idx ] . Occupy ( serviceCIDR ) ; err != nil { klog . Errorf ( " " , cidr , idx , serviceCIDR , err ) } } }
Marks all CIDRs with subNetMaskSize that belongs to serviceCIDR as used across all cidrs
so that they won't be assignable.
Marks all CIDRs with subNetMaskSize that belongs to serviceCIDR as used across all cidrs so that they won ' t be assignable .
// Checks if service CIDR has a nonempty intersection with cluster // CIDR. It is the case if either clusterCIDR contains serviceCIDR with // clusterCIDR's Mask applied (this means that clusterCIDR contains // serviceCIDR) or vice versa (which means that serviceCIDR contains // clusterCIDR). // if they don't overlap then ignore the filtering // at this point, len(cidrSet) == len(clusterCidr)