Unverified Commit 06e14c14 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #58780 from misterikkit/invalCache

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix equivalence 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. The test failure is exposed by #58555 **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: /ref #58222 **Special notes for your reviewer**: **Release note**: ```release-note NONE ``` /sig scheduling @kubernetes/sig-scheduling-pr-reviews
parents dd272ea3 59f0a999
......@@ -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