func (s SpaceInfos) FanOverlaysFor(subnetIDs IDSet) (SubnetInfos, error) {
	if len(subnetIDs) == 0 {
		return nil, nil
	}

	var located int
	var allOverlays SubnetInfos

	for _, space := range s {
		for _, sub := range space.Subnets {
			if subnetIDs.Contains(sub.ID) {
				overlays, err := space.Subnets.GetByUnderlayCIDR(sub.CIDR)
				if err != nil {
					return nil, errors.Trace(err)
				}
				allOverlays = append(allOverlays, overlays...)

				// If we have tested all of the inputs, we can exit early.
				located++
				if located >= len(subnetIDs) {
					return allOverlays, nil
				}
			}
		}
	}

	return allOverlays, nil
}
// FanOverlaysFor returns any subnets in this network topology that are
// fan overlays for the input subnet IDs.
FanOverlaysFor returns any subnets in this network topology that are
fan overlays for the input subnet IDs.
// FanOverlaysFor returns any subnets in this network topology that are // fan overlays for the input subnet IDs .
func (s SpaceInfos) FanOverlaysFor(subnetIDs IDSet) (SubnetInfos, error) {
	if len(subnetIDs) == 0 {
		return nil, nil
	}
	var located int
	var allOverlays SubnetInfos
	for _, space := range s {
		for _, sub := range space.Subnets {
			if subnetIDs.Contains(sub.ID) {
				overlays, err := space.Subnets.GetByUnderlayCIDR(sub.CIDR)
				if err != nil {
					return nil, errors.Trace(err)
				}
				allOverlays = append(allOverlays, overlays...)
				located++
				if located >= len(subnetIDs) {
					return allOverlays, nil
				}
			}
		}
	}
	return allOverlays, nil
}
func ( s SpaceInfos ) FanOverlaysFor ( subnetIDs IDSet ) ( SubnetInfos , error ) { if len ( subnetIDs ) == 0 { return nil , nil } var located int var allOverlays SubnetInfos for _ , space := range s { for _ , sub := range space . Subnets { if subnetIDs . Contains ( sub . ID ) { overlays , err := space . Subnets . GetByUnderlayCIDR ( sub . CIDR ) if err != nil { return nil , errors . Trace ( err ) } allOverlays = append ( allOverlays , overlays ... ) located ++ if located >= len ( subnetIDs ) { return allOverlays , nil } } } } return allOverlays , nil }
FanOverlaysFor returns any subnets in this network topology that are
fan overlays for the input subnet IDs.
FanOverlaysFor returns any subnets in this network topology that are fan overlays for the input subnet IDs .
// If we have tested all of the inputs, we can exit early.