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 validation for Deployment queue-name to fail fast #3555

Conversation

mbobrovskyi
Copy link
Contributor

@mbobrovskyi mbobrovskyi commented Nov 15, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Add validation for Deployment queue-name to fail fast

Which issue(s) this PR fixes:

Prepare #3528

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added validation for Deployment queue-name to fail fast

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Nov 15, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 15, 2024
Copy link

netlify bot commented Nov 15, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 2c5c894
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/673b18124af06c0008bd44ca

@mbobrovskyi mbobrovskyi force-pushed the feature/add-queue-name-validation-on-deployment branch from 1826829 to c74dad4 Compare November 15, 2024 18:38
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 15, 2024
@mbobrovskyi mbobrovskyi changed the title Add queue-name label validation on Deployment create. Add queue-name label validation on Deployment. Nov 15, 2024
@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 Nov 15, 2024
@mbobrovskyi
Copy link
Contributor Author

mbobrovskyi commented Nov 15, 2024

/hold for #3556 , #3558 and #3557

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 15, 2024
@mbobrovskyi
Copy link
Contributor Author

/cc @mimowo

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@mbobrovskyi mbobrovskyi force-pushed the feature/add-queue-name-validation-on-deployment branch from c74dad4 to 3b1b81e Compare November 18, 2024 09:03
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 18, 2024
@mimowo
Copy link
Contributor

mimowo commented Nov 18, 2024

Adding validation is tricky. Can you please summarize if the newly added validation prevents situations which would fail later anyway? Or it could work and we now start rejecting?

@mbobrovskyi
Copy link
Contributor Author

mbobrovskyi commented Nov 18, 2024

Adding validation is tricky. Can you please summarize if the newly added validation prevents situations which would fail later anyway? Or it could work and we now start rejecting?

Yes, it should prevent fail later on Pods.

UPDATED: If we don’t have validation on the Deployment, it will try to create pods with an invalid queue-name, which will fail.

@mbobrovskyi mbobrovskyi changed the title Add queue-name label validation on Deployment. Add validation for Deployment queue-name to fail fast Nov 18, 2024
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 18, 2024
@mbobrovskyi
Copy link
Contributor Author

/kind bug
/remove-kind feature

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 18, 2024
@k8s-ci-robot k8s-ci-robot removed the kind/feature Categorizes issue or PR as related to a new feature. label Nov 18, 2024
@mimowo
Copy link
Contributor

mimowo commented Nov 18, 2024

Thanks, yeah the validation is just a fail fast - it would not work before. In that case I'm ok to consider it a bugfix and include in 0.9.2, but it feels too late for 0.9.1.

cc @tenzen-y

pkg/controller/jobframework/validation.go Outdated Show resolved Hide resolved
pkg/controller/jobs/pod/pod_webhook.go Outdated Show resolved Hide resolved
@tenzen-y
Copy link
Member

Thanks, yeah the validation is just a fail fast - it would not work before. In that case I'm ok to consider it a bugfix and include in 0.9.2, but it feels too late for 0.9.1.

Yeah, this is the change that either enhances or bugs since even if this commit does not exist, the scheduling mechanism will not be broken. But, since this would be helpful valuation, I'm ok with cherry-pick to v0.9.

As @mimowo mentioned, the 0.9.1 patch commit has already closed. So, if users want to use this validation, they can use the latest release-0.9 branch image.

@mbobrovskyi
Copy link
Contributor Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 18, 2024
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.

Thx
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 18, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5b467310476baa2cee3bd866ad181b081973cdce

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mbobrovskyi, tenzen-y

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 Nov 18, 2024
@tenzen-y
Copy link
Member

/cherry-pick release-0.9

@k8s-infra-cherrypick-robot
Copy link
Contributor

@tenzen-y: once the present PR merges, I will cherry-pick it on top of release-0.9 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.9

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 merged commit c19bebf into kubernetes-sigs:main Nov 18, 2024
16 of 17 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.10 milestone Nov 18, 2024
@mbobrovskyi mbobrovskyi deleted the feature/add-queue-name-validation-on-deployment branch November 18, 2024 11:27
@k8s-infra-cherrypick-robot
Copy link
Contributor

@tenzen-y: #3555 failed to apply on top of branch "release-0.9":

Applying: Add queue-name label validation on Deployment create.
Using index info to reconstruct a base tree...
M	pkg/controller/jobs/deployment/deployment_webhook.go
M	pkg/controller/jobs/deployment/deployment_webhook_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/jobs/deployment/deployment_webhook_test.go
CONFLICT (content): Merge conflict in pkg/controller/jobs/deployment/deployment_webhook_test.go
Auto-merging pkg/controller/jobs/deployment/deployment_webhook.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Add queue-name label validation on Deployment create.

In response to this:

/cherry-pick release-0.9

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.

@mbobrovskyi
Copy link
Contributor Author

Ah, we also need to cherry-pick #3556 , #3558 and #3557.

@mimowo
Copy link
Contributor

mimowo commented Nov 18, 2024

@mbobrovskyi I checked locally that #3556 produces a conflict.
Can you please prepare a PR with these 3 preparatory commits?

@mbobrovskyi
Copy link
Contributor Author

/cherry-pick release-0.9

@k8s-infra-cherrypick-robot
Copy link
Contributor

@mbobrovskyi: new pull request created: #3580

In response to this:

/cherry-pick release-0.9

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.

kannon92 pushed a commit to kannon92/kueue that referenced this pull request Dec 5, 2024
…s#3555)

* Add queue-name label validation on Deployment create.

* Use clientObject on ValidateAnnotationAsCRDName and ValidateLabelAsCRDName.
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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants