Don't try to create routes for nodes w/o CIDRs assigned.

This commit is contained in:
CJ Cullen
2016-02-10 15:57:20 -08:00
parent 6bac4fdc37
commit 918b0ef479
2 changed files with 15 additions and 0 deletions

View File

@@ -75,6 +75,10 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
routeMap[route.TargetInstance] = route
}
for _, node := range nodes {
// Skip if the node hasn't been assigned a CIDR yet.
if node.Spec.PodCIDR == "" {
continue
}
// Check if we have a route for this node w/ the correct CIDR.
r := routeMap[node.Name]
if r == nil || r.DestinationCIDR != node.Spec.PodCIDR {