mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
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.
This commit is contained in:
parent
cdf26b05a1
commit
59f0a99909
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user