-
Notifications
You must be signed in to change notification settings - Fork 361
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
feat(translator): implement timeout in ClientTrafficPolicy #2667
Changes from 2 commits
75ca8ce
501b262
366d4bf
f46ea5a
1087f85
a71aadd
67e13ef
bfd489a
fc14517
d1cd4bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
clientTrafficPolicies: | ||
Check failure on line 1 in internal/gatewayapi/testdata/clienttrafficpolicy-timeout.in.yaml GitHub Actions / lint
|
||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: ClientTrafficPolicy | ||
metadata: | ||
namespace: envoy-gateway | ||
name: target-gateway | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: Gateway | ||
name: gateway | ||
namespace: envoy-gateway | ||
sectionName: http-1 | ||
timeout: | ||
http: | ||
requestReceivedTimeout: "5s" | ||
gateways: | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
namespace: envoy-gateway | ||
name: gateway | ||
spec: | ||
gatewayClassName: envoy-gateway-class | ||
listeners: | ||
- name: http-1 | ||
protocol: HTTP | ||
port: 80 | ||
allowedRoutes: | ||
namespaces: | ||
from: Same | ||
- name: http-2 | ||
protocol: HTTP | ||
port: 8080 | ||
allowedRoutes: | ||
namespaces: | ||
from: Same |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
clientTrafficPolicies: | ||
Check failure on line 1 in internal/gatewayapi/testdata/clienttrafficpolicy-timeout.out.yaml GitHub Actions / lint
|
||
- apiVersion: gateway.envoyproxy.io/v1alpha1 | ||
kind: ClientTrafficPolicy | ||
metadata: | ||
creationTimestamp: null | ||
name: target-gateway | ||
namespace: envoy-gateway | ||
spec: | ||
targetRef: | ||
group: gateway.networking.k8s.io | ||
kind: Gateway | ||
name: gateway | ||
namespace: envoy-gateway | ||
sectionName: http-1 | ||
timeout: | ||
http: | ||
requestReceivedTimeout: "5s" | ||
status: | ||
conditions: | ||
- lastTransitionTime: null | ||
message: ClientTrafficPolicy has been accepted. | ||
reason: Accepted | ||
status: "True" | ||
type: Accepted | ||
gateways: | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
creationTimestamp: null | ||
name: gateway | ||
namespace: envoy-gateway | ||
spec: | ||
gatewayClassName: envoy-gateway-class | ||
listeners: | ||
- allowedRoutes: | ||
namespaces: | ||
from: Same | ||
name: http-1 | ||
port: 80 | ||
protocol: HTTP | ||
- allowedRoutes: | ||
namespaces: | ||
from: Same | ||
name: http-2 | ||
port: 8080 | ||
protocol: HTTP | ||
status: | ||
listeners: | ||
- attachedRoutes: 0 | ||
conditions: | ||
- lastTransitionTime: null | ||
message: Sending translated listener configuration to the data plane | ||
reason: Programmed | ||
status: "True" | ||
type: Programmed | ||
- lastTransitionTime: null | ||
message: Listener has been successfully translated | ||
reason: Accepted | ||
status: "True" | ||
type: Accepted | ||
- lastTransitionTime: null | ||
message: Listener references have been resolved | ||
reason: ResolvedRefs | ||
status: "True" | ||
type: ResolvedRefs | ||
name: http-1 | ||
supportedKinds: | ||
- group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
- group: gateway.networking.k8s.io | ||
kind: GRPCRoute | ||
- attachedRoutes: 0 | ||
conditions: | ||
- lastTransitionTime: null | ||
message: Sending translated listener configuration to the data plane | ||
reason: Programmed | ||
status: "True" | ||
type: Programmed | ||
- lastTransitionTime: null | ||
message: Listener has been successfully translated | ||
reason: Accepted | ||
status: "True" | ||
type: Accepted | ||
- lastTransitionTime: null | ||
message: Listener references have been resolved | ||
reason: ResolvedRefs | ||
status: "True" | ||
type: ResolvedRefs | ||
name: http-2 | ||
supportedKinds: | ||
- group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
- group: gateway.networking.k8s.io | ||
kind: GRPCRoute | ||
infraIR: | ||
envoy-gateway/gateway: | ||
proxy: | ||
listeners: | ||
- address: null | ||
name: envoy-gateway/gateway/http-1 | ||
ports: | ||
- containerPort: 10080 | ||
name: http-1 | ||
protocol: HTTP | ||
servicePort: 80 | ||
- address: null | ||
name: envoy-gateway/gateway/http-2 | ||
ports: | ||
- containerPort: 8080 | ||
name: http-2 | ||
protocol: HTTP | ||
servicePort: 8080 | ||
metadata: | ||
labels: | ||
gateway.envoyproxy.io/owning-gateway-name: gateway | ||
gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway | ||
name: envoy-gateway/gateway | ||
xdsIR: | ||
envoy-gateway/gateway: | ||
accessLog: | ||
text: | ||
- path: /dev/stdout | ||
http: | ||
- address: 0.0.0.0 | ||
hostnames: | ||
- '*' | ||
isHTTP2: false | ||
name: envoy-gateway/gateway/http-1 | ||
path: | ||
mergeSlashes: true | ||
escapedSlashesAction: UnescapeAndRedirect | ||
port: 10080 | ||
timeout: | ||
http: | ||
RequestReceivedTimeout: "5s" | ||
- address: 0.0.0.0 | ||
hostnames: | ||
- '*' | ||
isHTTP2: false | ||
name: envoy-gateway/gateway/http-2 | ||
path: | ||
mergeSlashes: true | ||
escapedSlashesAction: UnescapeAndRedirect | ||
port: 8080 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
http: | ||
Check failure on line 1 in internal/xds/translator/testdata/in/xds-ir/client-timeout.yaml GitHub Actions / lint
|
||
- name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
path: | ||
mergeSlashes: true | ||
escapedSlashesAction: UnescapeAndRedirect | ||
routes: | ||
- name: "first-route" | ||
hostname: "*" | ||
destination: | ||
name: "first-route-dest" | ||
settings: | ||
- endpoints: | ||
- host: "1.2.3.4" | ||
port: 50000 | ||
timeout: | ||
http: | ||
RequestReceivedTimeout: "5s" |
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.
Small nit, but maybe this is slightly more readable as a switch statement:
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.
Thanks, Lior
I think that this suggestion offers a cleaner structure, but is it a convention for implementing switch cases? I'm not sure that all readers are familiar with the
fallthrough
keyword.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.
The
fallthrough
keyword is part of the language - readers should be familiar with the language.But this can also be written without it: