Skip to content

Commit

Permalink
Add AddressPrefix nil pointer check
Browse files Browse the repository at this point in the history
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
  • Loading branch information
helayoty committed Jan 24, 2023
1 parent 89a3fed commit b6e2ec9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/network/aci_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ func (pn *ProviderNetwork) setupNetwork(ctx context.Context, azConfig *auth.Conf
if errdefs.IsNotFound(err) && pn.SubnetCIDR == "" {
return fmt.Errorf("subnet '%s' is not found in vnet '%s' in resource group '%s' and subscription '%s' and subnet CIDR is not specified", pn.SubnetName, pn.VnetName, pn.VnetResourceGroup, pn.VnetSubscriptionID)
}
if err == nil {
currentSubnet := response.Subnet
currentSubnet := response.Subnet

if err == nil && currentSubnet.Properties.AddressPrefix != nil {
if pn.SubnetCIDR == "" {
pn.SubnetCIDR = *currentSubnet.Properties.AddressPrefix
}
Expand Down

0 comments on commit b6e2ec9

Please sign in to comment.