Skip to content

Commit 9bb4823

Browse files
committed
update test
Signed-off-by: zirain <zirain2009@gmail.com>
1 parent 2ea90b1 commit 9bb4823

File tree

2 files changed

+118
-8
lines changed

2 files changed

+118
-8
lines changed

internal/gatewayapi/testdata/backend-tls-settings-invalid.in.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ httpRoutes:
5959
- group: gateway.envoyproxy.io
6060
kind: Backend
6161
name: backend-1
62+
- apiVersion: gateway.networking.k8s.io/v1
63+
kind: HTTPRoute
64+
metadata:
65+
namespace: default
66+
name: httproute-2
67+
spec:
68+
parentRefs:
69+
- namespace: envoy-gateway
70+
name: gateway-1
71+
rules:
72+
- matches:
73+
- path:
74+
value: "/"
75+
backendRefs:
76+
- group: gateway.envoyproxy.io
77+
kind: Backend
78+
name: backend-2
6279

6380
configMaps:
6481
- apiVersion: v1
@@ -102,7 +119,7 @@ backendTLSPolicies:
102119
caCertificateRefs:
103120
- kind: ConfigMap
104121
group: ""
105-
name: istio-ca-root-cert
122+
name: ca-cmap
106123
hostname: example.com
107124
subjectAltNames:
108125
- type: URI
@@ -128,3 +145,13 @@ backends:
128145
- ip:
129146
address: 1.1.1.1
130147
port: 3001
148+
- apiVersion: gateway.envoyproxy.io/v1alpha1
149+
kind: Backend
150+
metadata:
151+
name: backend-2
152+
namespace: default
153+
spec:
154+
endpoints:
155+
- ip:
156+
address: 2.2.2.2
157+
port: 3001

internal/gatewayapi/testdata/backend-tls-settings-invalid.out.yaml

Lines changed: 90 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ backendTLSPolicies:
1414
caCertificateRefs:
1515
- group: ""
1616
kind: ConfigMap
17-
name: istio-ca-root-cert
17+
name: ca-cmap
1818
hostname: example.com
1919
subjectAltNames:
2020
- type: URI
@@ -28,9 +28,9 @@ backendTLSPolicies:
2828
namespace: envoy-gateway
2929
conditions:
3030
- lastTransitionTime: null
31-
message: Configmap istio-ca-root-cert not found in namespace default.
32-
reason: Invalid
33-
status: "False"
31+
message: Policy has been accepted.
32+
reason: Accepted
33+
status: "True"
3434
type: Accepted
3535
controllerName: gateway.envoyproxy.io/gatewayclass-controller
3636
backends:
@@ -57,6 +57,24 @@ backends:
5757
reason: Accepted
5858
status: "True"
5959
type: Accepted
60+
- apiVersion: gateway.envoyproxy.io/v1alpha1
61+
kind: Backend
62+
metadata:
63+
creationTimestamp: null
64+
name: backend-2
65+
namespace: default
66+
spec:
67+
endpoints:
68+
- ip:
69+
address: 2.2.2.2
70+
port: 3001
71+
status:
72+
conditions:
73+
- lastTransitionTime: null
74+
message: The Backend was accepted
75+
reason: Accepted
76+
status: "True"
77+
type: Accepted
6078
gateways:
6179
- apiVersion: gateway.networking.k8s.io/v1
6280
kind: Gateway
@@ -75,7 +93,7 @@ gateways:
7593
protocol: HTTP
7694
status:
7795
listeners:
78-
- attachedRoutes: 1
96+
- attachedRoutes: 2
7997
conditions:
8098
- lastTransitionTime: null
8199
message: Sending translated listener configuration to the data plane
@@ -126,15 +144,51 @@ httpRoutes:
126144
status: "True"
127145
type: Accepted
128146
- lastTransitionTime: null
129-
message: 'Failed to process route rule 0 backendRef 0: configmap istio-ca-root-cert
130-
not found in namespace default.'
147+
message: 'Failed to process route rule 0 backendRef 0: failed to locate TLS
148+
secret for client auth: envoy-gateway-system/client-auth specified in EnvoyProxy
149+
envoy-gateway-system/test.'
131150
reason: InvalidBackendTLS
132151
status: "False"
133152
type: ResolvedRefs
134153
controllerName: gateway.envoyproxy.io/gatewayclass-controller
135154
parentRef:
136155
name: gateway-1
137156
namespace: envoy-gateway
157+
- apiVersion: gateway.networking.k8s.io/v1
158+
kind: HTTPRoute
159+
metadata:
160+
creationTimestamp: null
161+
name: httproute-2
162+
namespace: default
163+
spec:
164+
parentRefs:
165+
- name: gateway-1
166+
namespace: envoy-gateway
167+
rules:
168+
- backendRefs:
169+
- group: gateway.envoyproxy.io
170+
kind: Backend
171+
name: backend-2
172+
matches:
173+
- path:
174+
value: /
175+
status:
176+
parents:
177+
- conditions:
178+
- lastTransitionTime: null
179+
message: Route is accepted
180+
reason: Accepted
181+
status: "True"
182+
type: Accepted
183+
- lastTransitionTime: null
184+
message: Resolved all the Object references for the Route
185+
reason: ResolvedRefs
186+
status: "True"
187+
type: ResolvedRefs
188+
controllerName: gateway.envoyproxy.io/gatewayclass-controller
189+
parentRef:
190+
name: gateway-1
191+
namespace: envoy-gateway
138192
infraIR:
139193
envoy-gateway/gateway-1:
140194
proxy:
@@ -235,6 +289,35 @@ xdsIR:
235289
distinct: false
236290
name: ""
237291
prefix: /
292+
- destination:
293+
metadata:
294+
kind: HTTPRoute
295+
name: httproute-2
296+
namespace: default
297+
name: httproute/default/httproute-2/rule/0
298+
settings:
299+
- addressType: IP
300+
endpoints:
301+
- host: 2.2.2.2
302+
port: 3001
303+
metadata:
304+
kind: Backend
305+
name: backend-2
306+
namespace: default
307+
name: httproute/default/httproute-2/rule/0/backend/0
308+
protocol: HTTP
309+
weight: 1
310+
hostname: '*'
311+
isHTTP2: false
312+
metadata:
313+
kind: HTTPRoute
314+
name: httproute-2
315+
namespace: default
316+
name: httproute/default/httproute-2/rule/0/match/0/*
317+
pathMatch:
318+
distinct: false
319+
name: ""
320+
prefix: /
238321
readyListener:
239322
address: 0.0.0.0
240323
ipFamily: IPv4

0 commit comments

Comments
 (0)