Repository navigation
feat: Adding extension server policy handling. - #3371
Conversation
754eb7b to
ee207be
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3371 +/- ##
==========================================
- Coverage 67.77% 67.26% -0.52%
==========================================
Files 166 167 +1
Lines 20037 20282 +245
==========================================
+ Hits 13581 13643 +62
- Misses 5466 5645 +179
- Partials 990 994 +4 ☔ View full report in Codecov by Sentry. |
e227366 to
bc120d8
Compare
|
cc @AliceProxy |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
d5d5bd9 to
7ba5af2
Compare
There was a problem hiding this comment.
lets make sure the field matches the type gwapiv1a2.PolicyStatus
There was a problem hiding this comment.
This is already validated by the compiler.
The val object is provided by the update parameter to the function invoked by the HandleSubscription function. It is a generic type, and it is narrowed to gwapiv1a2.PolicyStatus in line 407:
Alice-Lilith
left a comment
There was a problem hiding this comment.
No complaints from me. I 👍'd a few of Arko's suggestion, but I don't think this should really break any existing extensions other than needing to update the function signatures when they pull the latest package import with these changes.
079425f to
486aa61
Compare
|
/retest |
1 similar comment
|
/retest |
There was a problem hiding this comment.
still seeing the Logger and LoggedErrors being defined here
can we follow the approach taken in the gatewayapi lib where we have a top level errs field e.g.
Translate function and we'd append the errors returned from individual functions e.g.
There was a problem hiding this comment.
The difference is that in BackendTrafficPolicy the errors are aggregated into a single error and then stored in the policy status.
In this policy, the decision was not to update the policy status section for errors, which means that errors would need to be propagated all the way to the runner in order to be logged. This is a pretty large structural change.
I will remove the logger, but I think keeping the LoggedErrors approach is better.
There was a problem hiding this comment.
I was assuming this would be a best effort approach in the extension manager, but it looks like we've enhanced the gateway api translator to make sure the extension policy is conformant. In that case, lets populate the Status of the policy instead of using LoggedErrors
There was a problem hiding this comment.
When an extension policy doesn't implement the required contract - it has no targetRef or targetRefs attribute in its spec - then it's not possible to correctly place an error message in the policy status section. This is because finding the right place for the condition requires having the targetRef.
I think that there's value in logging this, though, to help with debugging sessions where the user wants to understand why the policy is not being sent to the extension server.
cca4bda to
cd72c97
Compare
|
/retest |
1 similar comment
|
/retest |
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
runner Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
an extension server configured. Signed-off-by: Lior Okman <[email protected]>
returned errors in the runner. Signed-off-by: Lior Okman <[email protected]>
5404675 to
3772293
Compare
|
/retest |
| result, err := t.Translate(resources) | ||
| if err != nil { | ||
| // Currently all errors that Translate returns should just be logged | ||
| r.Logger.Error(err, "errors detected during translation") |
There was a problem hiding this comment.
non blocking comment, something we can add in a follow up
is to send the err to the errChan similar to
https://github.com/envoyproxy/gateway/blob/3772293d83239bc568e62d3feac7f46e91c3cb6d/internal/infrastructure/runner/runner.go#L84C6-L84C20
to bump the metrics
What this PR does / why we need it:
This PR implements extension server policies which can be attached to HTTP listeners.
See the full description in the issue (#2975)
Which issue(s) this PR fixes:
Fixes #2975