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

Fork/uidlabel #4339

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

avrittrohwer
Copy link
Contributor

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it:

Makes it easy to kubectl describe the Workload that preempted another workload using the --selector CLI flag.

Which issue(s) this PR fixes:

Fixes #4038

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Adds a `kueue.x-k8s.io/workload-uid` label to Kueue Workload objects so they are easily retrieved by UID with `kubectl get workloads --selector=kueue.x-k8s.io/workload-uid=<UID>`

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Feb 21, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: avrittrohwer
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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 21, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @avrittrohwer. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 21, 2025
Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 670219c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/67b7cf7e05ade40008c51a2d
😎 Deploy Preview https://deploy-preview-4339--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.

@mimowo
Copy link
Contributor

mimowo commented Feb 21, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 21, 2025
@@ -603,6 +603,7 @@ const (
// +kubebuilder:resource:shortName={wl}

// Workload is the Schema for the workloads API
// +kubebuilder:validation:XValidation:rule="self.metadata.labels['kueue.x-k8s.io/workload-uid'] == oldSelf.metadata.labels['kueue.x-k8s.io/workload-uid']", message="field is immutable"
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably needs to be relaxed to "field is immutable once set" since this is set in workload_reconciler.
The bonus question: could it be set on workload creation with Mutating Admission Policy ( I know it is still Alpha, but we could already plan to move the setting code).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know how I could test out this validation rule? My current Reconcile unit test does not look like it exercises this rule

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I don't think you can test it at the UT level, because it is enforced by api-server.

We cover other validation rules at the level of integration tests example

@mimowo
Copy link
Contributor

mimowo commented Feb 21, 2025

I left some initial comment after brief scan, but leaving the first full pass to @gabesaba or @tenzen-y
/assign @gabesaba

@gabesaba
Copy link
Contributor

Hi. I noticed this is still marked as Draft. Is it ready for a review?

@avrittrohwer avrittrohwer marked this pull request as ready for review February 24, 2025 16:48
@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 Feb 24, 2025
@k8s-ci-robot
Copy link
Contributor

@avrittrohwer: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kueue-test-integration-main 670219c link true /test pull-kueue-test-integration-main
pull-kueue-verify-main 670219c link true /test pull-kueue-verify-main
pull-kueue-test-scheduling-perf-main 670219c link true /test pull-kueue-test-scheduling-perf-main

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-sigs/prow repository. I understand the commands that are listed here.

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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Make it easy to describe the preempting workload
4 participants