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
Move Taint/Toleration helpers to component-helpers repo #98445
Move Taint/Toleration helpers to component-helpers repo #98445
Conversation
@damemi: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/cc @ingvagabund
// TolerationsTolerateTaintsWithFilter checks if given tolerations tolerates | ||
// all the taints that apply to the filter in given taint list. | ||
// DEPRECATED: Please use FindMatchingUntoleratedTaint instead. | ||
func TolerationsTolerateTaintsWithFilter(tolerations []v1.Toleration, taints []v1.Taint, applyFilter taintsFilterFunc) bool { |
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.
Time to drop it given it's deprecated?
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.
Yeah I thought about that. Updated with it in a new commit
staging/src/k8s.io/component-helpers/scheduling/corev1/helpers_test.go
Outdated
Show resolved
Hide resolved
b436767
to
d402165
Compare
/retest |
d402165
to
80182aa
Compare
80182aa
to
eec5175
Compare
rebased |
eec5175
to
b5d0ff3
Compare
This is part of the goal for scheduling to remove dependencies on internal packages for the scheduling framework. It also provides these functions in an external location for other components and projects to import.
b5d0ff3
to
578ff3e
Compare
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damemi, lavalamp 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 |
@damemi: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Review the full test history for this PR. Silence the bot with an |
This seems to be cause regression in scheduler perf integration test:
|
// all the filtered taints, and returns the first taint without a toleration | ||
// Returns true if there is an untolerated taint | ||
// Returns false if all taints are tolerated | ||
func FindMatchingUntoleratedTaint(taints []v1.Taint, tolerations []v1.Toleration, inclusionFilter taintsFilterFunc) (v1.Taint, bool) { |
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.
A function that returns a negated boolean (Untolerated) is going to cause problems (it already did #98703), and we better fix it before the release is cut. The problem is that you would usually run into situation where you have to say !untolerated
, which is a double negation.
In this case, it would be simpler to make this function just return a pointer. And perhaps we can have another exported function that uses this and returns true or false, where true means that it passes all taints.
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.
The problem is that the deprecated function TolerationsTolerateTaintsWithFilter
which we removed had the opposite behavior (returned true
if all the taints were tolerated). So this should only affect people who were using the deprecated function, where we had to update their semantics (which caused the regression).
On its own, I don't think this function is too confusing. It's searching for Untolerated Taints, returning true if there are any. But if it would be clearer for some use cases to wrap this and negate it to search for Tolerated Taints, returning true if all are tolerated then that's fine.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This is part of the goal for scheduling to remove dependencies on internal
packages for the scheduling framework. It also provides these functions in an
external location for other components and projects to import.
Which issue(s) this PR fixes:
Ref #89930 and #91782
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/sig scheduling