本文整理匯總了Golang中github.com/cloudfoundry-incubator/bosh-fuzz-tests/input.Input.FindSubnetByIpRange方法的典型用法代碼示例。如果您正苦於以下問題:Golang Input.FindSubnetByIpRange方法的具體用法?Golang Input.FindSubnetByIpRange怎麽用?Golang Input.FindSubnetByIpRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry-incubator/bosh-fuzz-tests/input.Input
的用法示例。
在下文中一共展示了Input.FindSubnetByIpRange方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Apply
func (c *cloudProperties) Apply(input bftinput.Input, previousInput bftinput.Input) bftinput.Input {
for i, subject := range input.CloudConfig.AvailabilityZones {
prevSubject, found := previousInput.FindAzByName(subject.Name)
input.CloudConfig.AvailabilityZones[i].CloudProperties = c.FuzzCloudProperties(found, prevSubject.CloudProperties)
}
for i, subject := range input.CloudConfig.VmTypes {
prevSubject, found := previousInput.FindVmTypeByName(subject.Name)
input.CloudConfig.VmTypes[i].CloudProperties = c.FuzzCloudProperties(found, prevSubject.CloudProperties)
}
for i, subject := range input.CloudConfig.PersistentDiskPools {
prevSubject, found := previousInput.FindDiskPoolByName(subject.Name)
input.CloudConfig.PersistentDiskPools[i].CloudProperties = c.FuzzCloudProperties(found, prevSubject.CloudProperties)
}
for i, subject := range input.CloudConfig.PersistentDiskTypes {
prevSubject, found := previousInput.FindDiskPoolByName(subject.Name)
input.CloudConfig.PersistentDiskTypes[i].CloudProperties = c.FuzzCloudProperties(found, prevSubject.CloudProperties)
}
for i, subject := range input.CloudConfig.ResourcePools {
prevSubject, found := previousInput.FindResourcePoolByName(subject.Name)
input.CloudConfig.ResourcePools[i].CloudProperties = c.FuzzCloudProperties(found, prevSubject.CloudProperties)
}
// we can't really detect when a previous input has used cloud properties since we could
// validly used 0 properties
input.CloudConfig.Compilation.CloudProperties = c.FuzzCloudProperties(true, previousInput.CloudConfig.Compilation.CloudProperties)
for i, network := range input.CloudConfig.Networks {
if network.Subnets != nil {
for s, subject := range network.Subnets {
if subject.IpPool != nil {
// manual
prevSubject, found := previousInput.FindSubnetByIpRange(subject.IpPool.IpRange)
input.CloudConfig.Networks[i].Subnets[s].CloudProperties = c.FuzzCloudProperties(found, prevSubject.CloudProperties)
} else {
// dynamic
input.CloudConfig.Networks[i].Subnets[s].CloudProperties = c.FuzzCloudProperties(false, map[string]string{})
}
}
} else {
// vip
input.CloudConfig.Networks[i].CloudProperties = c.FuzzCloudProperties(false, map[string]string{})
}
}
return input
}