-
Notifications
You must be signed in to change notification settings - Fork 371
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
api: lua support in EnvoyExtensionPolicy #4932
Conversation
9e34b47
to
5a7a7ed
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4932 +/- ##
=======================================
Coverage 66.75% 66.75%
=======================================
Files 209 209
Lines 32254 32254
=======================================
Hits 21531 21531
Misses 9428 9428
Partials 1295 1295 ☔ View full report in Codecov by Sentry. |
5a7a7ed
to
70d648a
Compare
for a general idea, I think we should support in only in EnvoyExtensionPolicy? |
@zirain do you mean have no support for per route Lua filters at all? Or have only global filter for the first phase and support per route filter later? |
I means we can start from support it in EnvoyExtensionPolicy first. |
@rudrakhp Thanks for working on this! The API looks quite similar to the Envoy lua configuration, which is not ideal for EG. The Envoy Lua configuration is primarily designed as a programming API for a control plane, rather than for direct use by end users. Please refer to the comments and the other EG API to redefine the Lua API. Thanks! |
@zhaohuabing Thanks! I was actually wondering if we need to opinionated about what we expose to users or be as transparent as possible.
Ah that simplifies things! Have made some changes please do check! |
e096d3d
to
2e7c5cc
Compare
2e7c5cc
to
e838fc6
Compare
417f0e1
to
3af71fd
Compare
/retest |
3af71fd
to
6333bfe
Compare
/retest |
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.
LGTM thanks!
/retest |
// | ||
// +kubebuilder:validation:XValidation:rule="has(self.inline) ? !has(self.valueRef) : has(self.valueRef)",message="Exactly one of inline or valueRef must be set." | ||
type Lua struct { | ||
// Inline contains the source code as an inline string. |
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.
also needs a Type
enum here e.g.
gateway/api/v1alpha1/shared_types.go
Line 723 in 10a31f1
Type *ResponseValueType `json:"type"` |
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.
@arkodg I was kind of making it work by allowing only one of both value types, but added a type as suggested.
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.
yeah we've followed https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/1027-api-unions/README.md to implement unions in most places of the API to getter better schema for validation
6333bfe
to
09df0af
Compare
Signed-off-by: Rudrakh Panigrahi <[email protected]>
09df0af
to
acbc4b0
Compare
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.
LGTM thanks !
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.
LGTM thanks!
What type of PR is this?
api: lua support in EnvoyExtensionPolicy
What this PR does / why we need it:
Enables EGW users to define Lua filters natively without a need to patch Envoy filters.
Which issue(s) this PR fixes:
Related #4627
Release Notes: No