Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Implement CEL validation proc macro for generated CRDs #1621
Implement CEL validation proc macro for generated CRDs #1621
Changes from all commits
332423c
159e746
024cd08
d32bfe5
4eec7d8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 149 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L149
Check warning on line 153 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L153
Check warning on line 575 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L572-L575
Check warning on line 580 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L578-L580
Check warning on line 585 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L583-L585
Check warning on line 590 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L588-L590
Check warning on line 593 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L593
Check warning on line 598 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L597-L598
Check warning on line 600 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L600
Check warning on line 603 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L602-L603
Check warning on line 606 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L605-L606
Check warning on line 616 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L613-L616
Check warning on line 619 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L619
Check warning on line 626 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L621-L626
Check warning on line 629 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L628-L629
Check warning on line 632 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L631-L632
Check warning on line 636 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L636
Check warning on line 639 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L638-L639
Check warning on line 641 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L641
Check warning on line 644 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L643-L644
Check warning on line 646 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L646
Check warning on line 649 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L648-L649
Check warning on line 651 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L651
Check warning on line 654 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L653-L654
Check warning on line 656 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L656
Check warning on line 658 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L658
Check warning on line 667 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L667
Check warning on line 671 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L671
Check warning on line 676 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L675-L676
Check warning on line 680 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L678-L680
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff here could do with some comments. You're implementing a method fith a fixed name. Could this ave clashing issues? Can we parametrise such a function from kube-core instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as there is no structure Validation in the scope, there should not be a clash, but makes sense to add an override for such occasion 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be added now -
#[cel_validation(struct_name = "FooSpecValidation")]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess i am still confused about the temporary struct you are making. it seems to me that the #[cel_validation(struct_name = X struct X is there for you to implement a method, but that method feels like something we can define cleanly inside kube-core, and invoke from kube-derive.
Check warning on line 682 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L682
Check warning on line 700 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L699-L700
Check warning on line 707 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L705-L707
Check warning on line 712 in kube-derive/src/custom_resource.rs
Codecov / codecov/patch
kube-derive/src/custom_resource.rs#L712
Check warning on line 346 in kube-derive/src/lib.rs
Codecov / codecov/patch
kube-derive/src/lib.rs#L346
Check warning on line 350 in kube-derive/src/lib.rs
Codecov / codecov/patch
kube-derive/src/lib.rs#L350