-
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
Add a parameter to include soft topology spread constraints #474
Add a parameter to include soft topology spread constraints #474
Conversation
/cc @seanmalloy |
0168fab
to
00ebb30
Compare
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) |
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.
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?
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.
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.
00ebb30
to
8ba9cb1
Compare
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.
/approve
[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 |
/lgtm |
…t_constraints Add a parameter to include soft topology spread constraints
Fixes: #461