Skip to content

Commit

Permalink
Merge pull request #16358 from hakman/azure-subnet-vnet
Browse files Browse the repository at this point in the history
azure: Avoid spurious changes in VirtualNetwork
  • Loading branch information
k8s-ci-robot committed Feb 17, 2024
2 parents 1cbd622 + 4ae8f3c commit 5607c66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions upup/pkg/fi/cloudup/azuretasks/virtualnetwork.go
Expand Up @@ -36,7 +36,6 @@ type VirtualNetwork struct {
ResourceGroup *ResourceGroup
CIDR *string
Tags map[string]*string
Subnets []*network.Subnet
Shared *bool
}

Expand Down Expand Up @@ -90,9 +89,8 @@ func (n *VirtualNetwork) Find(c *fi.CloudupContext) (*VirtualNetwork, error) {
ResourceGroup: &ResourceGroup{
Name: n.ResourceGroup.Name,
},
CIDR: addrPrefixes[0],
Tags: found.Tags,
Subnets: found.Properties.Subnets,
CIDR: addrPrefixes[0],
Tags: found.Tags,
}, nil
}

Expand Down Expand Up @@ -144,7 +142,6 @@ func (*VirtualNetwork) RenderAzure(t *azure.AzureAPITarget, a, e, changes *Virtu
AddressSpace: &network.AddressSpace{
AddressPrefixes: []*string{e.CIDR},
},
Subnets: e.Subnets,
},
Tags: e.Tags,
}
Expand Down
4 changes: 2 additions & 2 deletions upup/pkg/fi/cloudup/new_cluster.go
Expand Up @@ -696,8 +696,8 @@ func setupZones(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.Stri
return nil, err
}

// We create default subnets named the same as the regions
subnetName := location
// We create default subnets named the same as the cluster
subnetName := cluster.Name

subnet := model.FindSubnet(cluster, subnetName)
if subnet == nil {
Expand Down

0 comments on commit 5607c66

Please sign in to comment.