Remove the validation on the Subnet IP Configuration Profile

NRP used to add a profile entry when a service association link is added to the subnet

Now, the profile entry is added when a network profile is created

This breaks the current validation
This commit is contained in:
robbiezhang
2018-10-16 19:52:23 +00:00
parent f5c47d59c4
commit c193fbe3c0

View File

@@ -351,10 +351,6 @@ func (p *ACIProvider) setupNetworkProfile(auth *client.Authentication) error {
return fmt.Errorf("unable to delegate subnet '%s' to Azure Container Instance as it is used by other Azure resource: '%v'.", p.subnetName, l) return fmt.Errorf("unable to delegate subnet '%s' to Azure Container Instance as it is used by other Azure resource: '%v'.", p.subnetName, l)
} }
} else { } else {
if subnet.SubnetPropertiesFormat.IPConfigurationProfiles != nil && len(*subnet.SubnetPropertiesFormat.IPConfigurationProfiles) != 0 {
return fmt.Errorf("unable to delegate subnet '%s' to Azure Container Instance as its IP configuration profiles is not empty.", p.subnetName)
}
for _, d := range *subnet.SubnetPropertiesFormat.Delegations { for _, d := range *subnet.SubnetPropertiesFormat.Delegations {
if d.ServiceDelegationPropertiesFormat != nil && *d.ServiceDelegationPropertiesFormat.ServiceName == subnetDelegationService { if d.ServiceDelegationPropertiesFormat != nil && *d.ServiceDelegationPropertiesFormat.ServiceName == subnetDelegationService {
createSubnet = false createSubnet = false