Don't update NodeNetworkUnavailable condition if it's already set correctly

This commit is contained in:
Wojciech Tyczynski 2016-09-16 21:03:20 +02:00
parent a665002d80
commit d7d6249781

View File

@ -137,7 +137,11 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
}
}(node.Name, nameHint, route)
} else {
rc.updateNetworkingCondition(node.Name, true)
// Update condition only if it doesn't reflect the current state.
_, condition := api.GetNodeCondition(&node.Status, api.NodeNetworkUnavailable)
if condition == nil || condition.Status != api.ConditionFalse {
rc.updateNetworkingCondition(node.Name, true)
}
}
nodeCIDRs[node.Name] = node.Spec.PodCIDR
}