Skip to content

Validate groups list. #1143

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

Closed
guettli opened this issue Feb 3, 2025 · 5 comments
Closed

Validate groups list. #1143

guettli opened this issue Feb 3, 2025 · 5 comments

Comments

@guettli
Copy link

guettli commented Feb 3, 2025

I had accidentally added the version to the group: groups=example.com/v1beta1

Broken:

//+kubebuilder:webhook:path=/validate-example-com-v1beta1-foo,mutating=false,failurePolicy=fail,sideEffects=None,groups=example.com/v1beta1,resources=foos,verbs=create;update,versions=v1beta1,name=validation.example.syself.com,admissionReviewVersions={v1,v1beta1}

After removing "v1beta1" it worked.

Good:

//+kubebuilder:webhook:path=/validate-example-com-v1beta1-foo,mutating=false,failurePolicy=fail,sideEffects=None,groups=example.com,resources=foos,verbs=create;update,versions=v1beta1,name=validation.example.syself.com,admissionReviewVersions={v1,v1beta1}

It would be nice if the controller-tools would detect that.

@JoelSpeed
Copy link
Contributor

I believe controller-gen should be able to verify this string while generating the webhook manifests, and ensure that the group is actually a group, and not a group version.

This feels to me like a valuable validation to add, to help our users out

@sbueringer
Copy link
Member

Seems reasonable. Feel free to open a PR. Could be probably done roughly in this area of the code: #1128

@guettli
Copy link
Author

guettli commented Feb 4, 2025

I created #1144

@sbueringer
Copy link
Member

/close

xref #1144 (comment)

@k8s-ci-robot
Copy link
Contributor

@sbueringer: Closing this issue.

In response to this:

/close

xref #1144 (comment)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants