Commit 59f0a999 authored by Jonathan Basseri's avatar Jonathan Basseri

Fix equiv. cache invalidation of Node condition.

Equivalence cache for CheckNodeConditionPred becomes invalid when Node.Spec.Unschedulable changes. This can happen even if Node.Status.Conditions does not change, so move the logic around. This logic is covered by integration test "test/integration/scheduler".TestUnschedulableNodes but equivalence cache is currently skipped when test pods have no OwnerReference.
parent cdf26b05
......@@ -781,11 +781,13 @@ func (c *configFactory) invalidateCachedPredicatesOnNodeUpdate(newNode *v1.Node,
}
if oldConditions[v1.NodeReady] != newConditions[v1.NodeReady] ||
oldConditions[v1.NodeOutOfDisk] != newConditions[v1.NodeOutOfDisk] ||
oldConditions[v1.NodeNetworkUnavailable] != newConditions[v1.NodeNetworkUnavailable] ||
newNode.Spec.Unschedulable != oldNode.Spec.Unschedulable {
oldConditions[v1.NodeNetworkUnavailable] != newConditions[v1.NodeNetworkUnavailable] {
invalidPredicates.Insert("CheckNodeCondition")
}
}
if newNode.Spec.Unschedulable != oldNode.Spec.Unschedulable {
invalidPredicates.Insert("CheckNodeCondition")
}
c.equivalencePodCache.InvalidateCachedPredicateItem(newNode.GetName(), invalidPredicates)
}
}
......
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