Skip to content
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

Add test cases for soft constraints/multi constraints #565

Merged
merged 1 commit into from
May 13, 2021

Conversation

damemi
Copy link
Contributor

@damemi damemi commented May 10, 2021

Fixes #564
/kind bug

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 10, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 10, 2021
@@ -126,7 +126,7 @@ func RemovePodsViolatingTopologySpreadConstraint(
for _, pod := range namespacePods.Items {
for _, constraint := range pod.Spec.TopologySpreadConstraints {
// Ignore soft topology constraints if they are not included
if (strategy.Params == nil || !strategy.Params.IncludeSoftConstraints) && constraint.WhenUnsatisfiable != v1.DoNotSchedule {
if constraint.WhenUnsatisfiable == v1.ScheduleAnyway && (strategy.Params == nil || !strategy.Params.IncludeSoftConstraints) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this to be a bit more readable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for inclusion, not exclusion

@damemi damemi force-pushed the issue-564 branch 2 times, most recently from a0f160b to 5ae5690 Compare May 10, 2021 17:34
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 10, 2021
@damemi damemi force-pushed the issue-564 branch 2 times, most recently from 3f8ceb9 to 9faad05 Compare May 10, 2021 17:44
@damemi damemi changed the title [WIP] Add test cases for soft constraints/multi constraints Add test cases for soft constraints/multi constraints May 10, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 10, 2021
@damemi
Copy link
Contributor Author

damemi commented May 10, 2021

Turns out there wasn't actually a bug with this, but we should still have these test cases anyway

@lixiang233
Copy link
Contributor

/retest

@lixiang233
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 13, 2021
@k8s-ci-robot k8s-ci-robot merged commit 9b26abd into kubernetes-sigs:master May 13, 2021
briend pushed a commit to briend/descheduler that referenced this pull request Feb 11, 2022
Add test cases for soft constraints/multi constraints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RemovePodsViolatingTopologySpreadConstraint includeSoftConstraints: true not evicting
4 participants