outbound: Add error type to TCP and TLS routes#387
Conversation
Signed-off-by: Zahari Dichev <[email protected]>
cratelyn
left a comment
There was a problem hiding this comment.
format nits, not related to the mechanical changes made.
proto/outbound.proto
Outdated
|
|
||
| // Must have at least one rule. | ||
| repeated Rule rules = 3; | ||
| repeated Rule rules = 3; |
There was a problem hiding this comment.
nit, trailing whitespace added
proto/outbound.proto
Outdated
| // that targets a particular backend should be failed. | ||
| message BackendError { | ||
| string message = 1; | ||
| } No newline at end of file |
proto/outbound.proto
Outdated
| message WeightedRouteBackend { | ||
| RouteBackend backend = 1; | ||
| uint32 weight = 2; | ||
| BackendError error = 3; |
There was a problem hiding this comment.
Should this field be on RouteBackend? so that backend errors can be raised on FirstAvailable distributions.
proto/outbound.proto
Outdated
| // Error type that is used to indicate that any traffic | ||
| // that targets a particular backend should be failed. | ||
| message BackendError { |
There was a problem hiding this comment.
I'd be inclined to move this as a submessage of RouteBackend, where it's actually used, and perhaps call it something like Invalid, to make it clear that this is a failure used to indicate an illegal backend configuration.
proto/outbound.proto
Outdated
| message RouteError { | ||
| string message = 1; | ||
| } |
There was a problem hiding this comment.
Rather than use free-form string messages to indicate denials, I suspect we want a oneof or enum to clearly enumerate the types of route errors that may be emitted.
I'd also be inclined to move this message within the Route messages, as we do for other types.
Signed-off-by: Zahari Dichev <[email protected]>
| Invalid invalid = 2; | ||
|
|
||
| message Invalid { | ||
| string message = 1; | ||
| } |
This PR adds explicit error types to TLS and TCP routes and backends. They serve two distinct purposes:
InvalidKindreasons).This behavior is governed by the Gateway API GEP described here: https://gateway-api.sigs.k8s.io/geps/gep-1364/
Signed-off-by: Zahari Dichev [email protected]