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

Make Preemption.BorrowWithinCohort Incompatible with FairSharing #4298

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gabesaba
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

With #4165, these parameters together becomes a no-op.

Based on #4165 (comment), we decided to split out the logic and documentation change from the validation changes, as we may only cherry-pick the first set.

Which issue(s) this PR fixes:

Related to #3779

Special notes for your reviewer:

Does this PR introduce a user-facing change?

ClusterQueue.Preemption.BorrowWithinCohort is now incompatible with FairSharing. This will be enforced upon ClusterQueue creation and update.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Feb 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gabesaba
Once this PR has been reviewed and has the lgtm label, please assign tenzen-y for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 18, 2025
Copy link

netlify bot commented Feb 18, 2025

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 29f7163
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/67b4845370ed3400088d9215
😎 Deploy Preview https://deploy-preview-4298--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Just some nits. basically lgtm, thanks!

var allErrs field.ErrorList
if preemption.ReclaimWithinCohort == kueue.PreemptionPolicyNever &&
preemption.BorrowWithinCohort != nil &&
preemption.BorrowWithinCohort.Policy != kueue.BorrowWithinCohortPolicyNever {
allErrs = append(allErrs, field.Invalid(path, preemption, "reclaimWithinCohort=Never and borrowWithinCohort.Policy!=Never"))
}
if w.fairSharingEnabled && preemption.BorrowWithinCohort != nil && preemption.BorrowWithinCohort.Policy != kueue.BorrowWithinCohortPolicyNever {
allErrs = append(allErrs, field.Invalid(path, preemption.BorrowWithinCohort, "FairSharing incompatible with borrowWithinCohort"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
allErrs = append(allErrs, field.Invalid(path, preemption.BorrowWithinCohort, "FairSharing incompatible with borrowWithinCohort"))
allErrs = append(allErrs, field.Invalid(path.Child("borrowWithinCohort").Child("policy"), preemption.BorrowWithinCohort.Policy, "FairSharing incompatible with borrowWithinCohort except for Never policy"))

Actually, this incompatible came from policy, right?

Copy link
Member

Choose a reason for hiding this comment

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

Nice these UTs!

@tenzen-y
Copy link
Member

I think this actually enhancement to improve UX.
/remove-kind cleanup
/kind feature

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

3 participants