-
Notifications
You must be signed in to change notification settings - Fork 33
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
refactor: align using CEL for target ref validation #364
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #364 +/- ##
==========================================
- Coverage 66.14% 65.21% -0.93%
==========================================
Files 35 35
Lines 3843 3795 -48
==========================================
- Hits 2542 2475 -67
- Misses 1113 1126 +13
- Partials 188 194 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ce7f1db
to
a0a1d63
Compare
a0a1d63
to
63f491a
Compare
@@ -116,6 +116,8 @@ func (l Limit) CountersAsStringList() []string { | |||
// RateLimitPolicySpec defines the desired state of RateLimitPolicy | |||
type RateLimitPolicySpec struct { | |||
// TargetRef identifies an API object to apply policy to. | |||
// +kubebuilder:validation:XValidation:rule="self.group == 'gateway.networking.k8s.io'",message="Invalid targetRef.group. The only supported value is 'gateway.networking.k8s.io'" |
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.
❤️
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.
🧇
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.
great contribution!
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 wonder if we aren't ready to remove as well the validation at:
// prevents usage of routeSelectors in a gateway AuthPolicy |
and
// prevents usage of routeSelectors in a gateway RLP |
WDYT?
@guicassolato Yes, I think kuadrant-operator/api/v1beta2/authpolicy_types.go Lines 125 to 131 in 13c75de
But
I'll add a new commit to align |
d450296
to
aa55a03
Compare
Validation()
function and add new integration tests for testing CEL validation