-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(TopologySpread) Evict pods with selectors that match multiple nodes #525
(TopologySpread) Evict pods with selectors that match multiple nodes #525
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damemi, uthark The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -289,11 +289,11 @@ func balanceDomains( | |||
// however we still account for it "being evicted" so the algorithm can complete | |||
// TODO(@damemi): Since we don't order pods wrt their affinities, we should refactor this to skip the current pod | |||
// but still try to get the required # of movePods (instead of just chopping that value off the slice above) | |||
if aboveToEvict[k].Spec.NodeSelector != nil || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you break the changes into two steps (in the same commit)?
- create
isRequiredDuringSchedulingIgnoredDuringExecution = aboveToEvict[k].Spec.Affinity != nil && aboveToEvict[k].Spec.Affinity.NodeAffinity != nil && aboveToEvict[k].Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution != nil
variable so it's easier to read the condition - fix the bug
In which case the change will look like:
aboveToEvict[k].Spec.NodeSelector != nil ||
(
isRequiredDuringSchedulingIgnoredDuringExecution &&
nodesPodFitsOnBesidesCurrent(aboveToEvict[k], nodeMap) == 0
)
-->
(
aboveToEvict[k].Spec.NodeSelector != nil || isRequiredDuringSchedulingIgnoredDuringExecution
) &&
nodesPodFitsOnBesidesCurrent(aboveToEvict[k], nodeMap) == 0
After which it's clear why the change is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change to improve the readability
4da1862
to
af26b57
Compare
Thanks @ingvagabund, updated |
/lgtm |
…lector-fix (TopologySpread) Evict pods with selectors that match multiple nodes
Fixes #524