Commit 0cd3cb75 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38334 from mogthesprog/morganj/remove-azure-subnet-routetable-check

Automatic merge from submit-queue (batch tested with PRs 38638, 38334) Remove Azure Subnet RouteTable check **What this PR does / why we need it**: PR Removes the subnet configuration check for Azure cloudprovider. The subnet check ensures that the subnet is associated with the Route Table. However if the VNET is in a different Azure Resource Group then the check fails, even if the subnet is already valid. This a stop gap fix, to allow Kubernetes to be deployed to Custom VNETs in Azure, that may reside in a different resource group to the cluster. fixes #38134 @colemickens
parents 911d1065 f82e872a
...@@ -87,27 +87,6 @@ func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *clo ...@@ -87,27 +87,6 @@ func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *clo
} }
} }
// ensure the subnet is properly configured
subnet, err := az.SubnetsClient.Get(az.ResourceGroup, az.VnetName, az.SubnetName, "")
if err != nil {
// 404 is fatal here
return err
}
if subnet.RouteTable != nil {
if *subnet.RouteTable.ID != *routeTable.ID {
return fmt.Errorf("The subnet has a route table, but it was unrecognized. Refusing to modify it. active_routetable=%q expected_routetable=%q", *subnet.RouteTable.ID, *routeTable.ID)
}
} else {
subnet.RouteTable = &network.RouteTable{
ID: routeTable.ID,
}
glog.V(3).Info("create: updating subnet")
_, err := az.SubnetsClient.CreateOrUpdate(az.ResourceGroup, az.VnetName, az.SubnetName, subnet, nil)
if err != nil {
return err
}
}
targetIP, err := az.getIPForMachine(kubeRoute.TargetNode) targetIP, err := az.getIPForMachine(kubeRoute.TargetNode)
if err != nil { if err != nil {
return err return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment