-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(translator): implement timeout in ClientTrafficPolicy (#2667)
* feat(translator): implement timeout in ClientTrafficPolicy Signed-off-by: Yael Shechter <yael.shechter@sap.com> * fix pr comment, lint and test Signed-off-by: Yael Shechter <yael.shechter@sap.com> * change file formats Signed-off-by: Yael Shechter <yael.shechter@sap.com> * fix indentation in yaml Signed-off-by: Yael Shechter <yael.shechter@sap.com> * fix gen-check Signed-off-by: Yael Shechter <yael.shechter@sap.com> * add coverage Signed-off-by: Yael Shechter <yael.shechter@sap.com>
- Loading branch information
1 parent
4c79ef9
commit c30d037
Showing
14 changed files
with
508 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
internal/gatewayapi/testdata/clienttrafficpolicy-timeout-with-error.in.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
clientTrafficPolicies: | ||
- 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 | ||
timeout: | ||
http: | ||
requestReceivedTimeout: "5sec" | ||
gateways: | ||
- apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
namespace: envoy-gateway | ||
name: gateway | ||
spec: | ||
gatewayClassName: envoy-gateway-class | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
allowedRoutes: | ||
namespaces: | ||
from: Same | ||
|
95 changes: 95 additions & 0 deletions
95
internal/gatewayapi/testdata/clienttrafficpolicy-timeout-with-error.out.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
clientTrafficPolicies: | ||
- 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 | ||
timeout: | ||
http: | ||
requestReceivedTimeout: 5sec | ||
status: | ||
conditions: | ||
- lastTransitionTime: null | ||
message: 'Time: unknown unit "sec" in duration "5sec"' | ||
reason: Invalid | ||
status: "False" | ||
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 | ||
port: 80 | ||
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 | ||
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 | ||
ports: | ||
- containerPort: 10080 | ||
name: http | ||
protocol: HTTP | ||
servicePort: 80 | ||
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 | ||
path: | ||
escapedSlashesAction: UnescapeAndRedirect | ||
mergeSlashes: true | ||
port: 10080 |
38 changes: 38 additions & 0 deletions
38
internal/gatewayapi/testdata/clienttrafficpolicy-timeout.in.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
clientTrafficPolicies: | ||
- 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 | ||
|
144 changes: 144 additions & 0 deletions
144
internal/gatewayapi/testdata/clienttrafficpolicy-timeout.out.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
clientTrafficPolicies: | ||
- 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: | ||
escapedSlashesAction: UnescapeAndRedirect | ||
mergeSlashes: true | ||
port: 10080 | ||
timeout: | ||
http: | ||
requestReceivedTimeout: 5s | ||
- address: 0.0.0.0 | ||
hostnames: | ||
- '*' | ||
isHTTP2: false | ||
name: envoy-gateway/gateway/http-2 | ||
path: | ||
escapedSlashesAction: UnescapeAndRedirect | ||
mergeSlashes: true | ||
port: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.