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 validations to clusterQueue resource name #309

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

kerthcet
Copy link
Contributor

@kerthcet kerthcet commented Aug 2, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This is part of #171.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 2, 2022
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 2, 2022
apis/kueue/v1alpha1/clusterqueue_webhook.go Outdated Show resolved Hide resolved
apis/kueue/v1alpha1/clusterqueue_webhook.go Outdated Show resolved Hide resolved
apis/kueue/validation/validation.go Outdated Show resolved Hide resolved
@kerthcet
Copy link
Contributor Author

kerthcet commented Aug 3, 2022

Reduce the complexity of validations of resource name, we can add more rules when needed in the future.

@ahg-g
Copy link
Contributor

ahg-g commented Aug 3, 2022

Can we add the other validations to this PR now that it become simpler after removing the strict name validation?

@kerthcet
Copy link
Contributor Author

kerthcet commented Aug 3, 2022

Leave the Two resources can either have completely different flavors or they must share all flavors and their order. for another PR, the other validations done.

@kerthcet
Copy link
Contributor Author

kerthcet commented Aug 3, 2022

@ahg-g PTAL

defer func() {
var newCQ kueue.ClusterQueue
gomega.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(cq), &newCQ)).Should(gomega.Succeed())
controllerutil.RemoveFinalizer(&newCQ, kueue.ResourceInUseFinalizerName)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we explicitly remove the finalizer here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have no controller in webhook integration tests.

test/integration/webhook/v1alpha1/clusterqueue_test.go Outdated Show resolved Hide resolved
@kerthcet
Copy link
Contributor Author

kerthcet commented Aug 4, 2022

Addressed the comments.

@ahg-g
Copy link
Contributor

ahg-g commented Aug 4, 2022

Thanks, pls squash

Signed-off-by: kerthcet <kerthcet@gmail.com>
@kerthcet
Copy link
Contributor Author

kerthcet commented Aug 4, 2022

Done :)

@ahg-g
Copy link
Contributor

ahg-g commented Aug 4, 2022

/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 Aug 4, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, kerthcet

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 Aug 4, 2022
@k8s-ci-robot k8s-ci-robot merged commit eb1be2c into kubernetes-sigs:main Aug 4, 2022
@kerthcet kerthcet deleted the feat/webhook-for-cq branch August 4, 2022 15:38
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/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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