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 a parameter to include soft topology spread constraints #474

Merged

Conversation

lixiang233
Copy link
Contributor

Fixes: #461

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 18, 2020
@lixiang233
Copy link
Contributor Author

/cc @seanmalloy
/assign @damemi
/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 18, 2020
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 12, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 18, 2021
@lixiang233
Copy link
Contributor Author

Rebased, PTAL @damemi @seanmalloy @ingvagabund

@@ -76,7 +76,7 @@ func RemovePodsViolatingTopologySpreadConstraint(
nodes []*v1.Node,
podEvictor *evictions.PodEvictor,
) {
thresholdPriority, includedNamespaces, excludedNamespaces, err := validateAndParseTopologySpreadParams(ctx, client, strategy.Params)
includeSoftConstraints, thresholdPriority, includedNamespaces, excludedNamespaces, err := validateAndParseTopologySpreadParams(ctx, client, strategy.Params)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think includeSoftConstraints needs to be validated by this function, as it just complicates the function signature (and isn't actually validated, since it's just a bool).

We can just use params.IncludeSoftConstraints on L129 and add a nil check in that if statement for params so we don't get a dereference panic. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally wanted to check params only once so I put it in validateAndParseTopologySpreadParams.

It's more concise to do the nil check inside that if statement, I'll update soon.

Copy link
Contributor

@damemi damemi left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi, lixiang233

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2021
@ingvagabund
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 Jan 21, 2021
@k8s-ci-robot k8s-ci-robot merged commit f24b367 into kubernetes-sigs:master Jan 21, 2021
@lixiang233 lixiang233 deleted the Ft_include_soft_constraints branch January 22, 2021 03:15
briend pushed a commit to briend/descheduler that referenced this pull request Feb 11, 2022
…t_constraints

Add a parameter to include soft topology spread 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/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RemovePodsViolatingTopologySpreadConstraint Support Soft Constraints
4 participants