Skip to content

Commit f404a9c

Browse files
authored
chore: update testdata to covered multiple listener in one gateway (#8710)
Signed-off-by: zirain <zirain2009@gmail.com>
1 parent 828cd01 commit f404a9c

2 files changed

Lines changed: 222 additions & 3 deletions

File tree

internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit.in.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ gateways:
1313
allowedRoutes:
1414
namespaces:
1515
from: All
16+
- name: http-8080
17+
protocol: HTTP
18+
port: 8080
19+
allowedRoutes:
20+
namespaces:
21+
from: All
22+
- name: http-8081
23+
protocol: HTTP
24+
port: 8081
25+
allowedRoutes:
26+
namespaces:
27+
from: All
1628
- apiVersion: gateway.networking.k8s.io/v1
1729
kind: Gateway
1830
metadata:
@@ -51,7 +63,6 @@ grpcRoutes:
5163
parentRefs:
5264
- namespace: envoy-gateway
5365
name: gateway-1
54-
sectionName: http
5566
rules:
5667
- backendRefs:
5768
- name: service-1

internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit.out.yaml

Lines changed: 210 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ gateways:
160160
name: http
161161
port: 80
162162
protocol: HTTP
163+
- allowedRoutes:
164+
namespaces:
165+
from: All
166+
name: http-8080
167+
port: 8080
168+
protocol: HTTP
169+
- allowedRoutes:
170+
namespaces:
171+
from: All
172+
name: http-8081
173+
port: 8081
174+
protocol: HTTP
163175
status:
164176
listeners:
165177
- attachedRoutes: 1
@@ -185,6 +197,52 @@ gateways:
185197
kind: HTTPRoute
186198
- group: gateway.networking.k8s.io
187199
kind: GRPCRoute
200+
- attachedRoutes: 1
201+
conditions:
202+
- lastTransitionTime: null
203+
message: Sending translated listener configuration to the data plane
204+
reason: Programmed
205+
status: "True"
206+
type: Programmed
207+
- lastTransitionTime: null
208+
message: Listener has been successfully translated
209+
reason: Accepted
210+
status: "True"
211+
type: Accepted
212+
- lastTransitionTime: null
213+
message: Listener references have been resolved
214+
reason: ResolvedRefs
215+
status: "True"
216+
type: ResolvedRefs
217+
name: http-8080
218+
supportedKinds:
219+
- group: gateway.networking.k8s.io
220+
kind: HTTPRoute
221+
- group: gateway.networking.k8s.io
222+
kind: GRPCRoute
223+
- attachedRoutes: 1
224+
conditions:
225+
- lastTransitionTime: null
226+
message: Sending translated listener configuration to the data plane
227+
reason: Programmed
228+
status: "True"
229+
type: Programmed
230+
- lastTransitionTime: null
231+
message: Listener has been successfully translated
232+
reason: Accepted
233+
status: "True"
234+
type: Accepted
235+
- lastTransitionTime: null
236+
message: Listener references have been resolved
237+
reason: ResolvedRefs
238+
status: "True"
239+
type: ResolvedRefs
240+
name: http-8081
241+
supportedKinds:
242+
- group: gateway.networking.k8s.io
243+
kind: HTTPRoute
244+
- group: gateway.networking.k8s.io
245+
kind: GRPCRoute
188246
- apiVersion: gateway.networking.k8s.io/v1
189247
kind: Gateway
190248
metadata:
@@ -273,7 +331,6 @@ grpcRoutes:
273331
parentRefs:
274332
- name: gateway-1
275333
namespace: envoy-gateway
276-
sectionName: http
277334
rules:
278335
- backendRefs:
279336
- name: service-1
@@ -295,7 +352,6 @@ grpcRoutes:
295352
parentRef:
296353
name: gateway-1
297354
namespace: envoy-gateway
298-
sectionName: http
299355
- apiVersion: gateway.networking.k8s.io/v1alpha2
300356
kind: GRPCRoute
301357
metadata:
@@ -376,6 +432,18 @@ infraIR:
376432
name: http-80
377433
protocol: HTTP
378434
servicePort: 80
435+
- name: envoy-gateway/gateway-1/http-8080
436+
ports:
437+
- containerPort: 8080
438+
name: http-8080
439+
protocol: HTTP
440+
servicePort: 8080
441+
- name: envoy-gateway/gateway-1/http-8081
442+
ports:
443+
- containerPort: 8081
444+
name: http-8081
445+
protocol: HTTP
446+
servicePort: 8081
379447
metadata:
380448
labels:
381449
gateway.envoyproxy.io/owning-gateway-name: gateway-1
@@ -522,6 +590,146 @@ xdsIR:
522590
distinct: false
523591
name: ""
524592
safeRegex: ^/user(/.*|\?.*|#.*|;.*|$)
593+
- address: 0.0.0.0
594+
externalPort: 8080
595+
grpc:
596+
enableGRPCStats: true
597+
enableGRPCWeb: true
598+
hostnames:
599+
- '*'
600+
metadata:
601+
kind: Gateway
602+
name: gateway-1
603+
namespace: envoy-gateway
604+
sectionName: http-8080
605+
name: envoy-gateway/gateway-1/http-8080
606+
path:
607+
escapedSlashesAction: UnescapeAndRedirect
608+
mergeSlashes: true
609+
port: 8080
610+
routes:
611+
- destination:
612+
metadata:
613+
kind: GRPCRoute
614+
name: grpcroute-1
615+
namespace: default
616+
name: grpcroute/default/grpcroute-1/rule/0
617+
settings:
618+
- addressType: IP
619+
endpoints:
620+
- host: 7.7.7.7
621+
port: 8080
622+
metadata:
623+
kind: Service
624+
name: service-1
625+
namespace: default
626+
sectionName: "8080"
627+
name: grpcroute/default/grpcroute-1/rule/0/backend/0
628+
protocol: GRPC
629+
weight: 1
630+
hostname: '*'
631+
isHTTP2: true
632+
metadata:
633+
kind: GRPCRoute
634+
name: grpcroute-1
635+
namespace: default
636+
policies:
637+
- kind: BackendTrafficPolicy
638+
name: policy-for-gateway
639+
namespace: envoy-gateway
640+
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
641+
traffic:
642+
rateLimit:
643+
global:
644+
rules:
645+
- headerMatches:
646+
- distinct: false
647+
exact: one
648+
name: x-user-id
649+
- distinct: true
650+
name: x-org-id
651+
- distinct: false
652+
exact: admin
653+
invert: true
654+
name: x-org-id
655+
limit:
656+
requests: 10
657+
unit: Hour
658+
name: envoy-gateway/policy-for-gateway/rule/0
659+
pathMatch:
660+
distinct: false
661+
name: ""
662+
safeRegex: ^/user(/.*|\?.*|#.*|;.*|$)
663+
- address: 0.0.0.0
664+
externalPort: 8081
665+
grpc:
666+
enableGRPCStats: true
667+
enableGRPCWeb: true
668+
hostnames:
669+
- '*'
670+
metadata:
671+
kind: Gateway
672+
name: gateway-1
673+
namespace: envoy-gateway
674+
sectionName: http-8081
675+
name: envoy-gateway/gateway-1/http-8081
676+
path:
677+
escapedSlashesAction: UnescapeAndRedirect
678+
mergeSlashes: true
679+
port: 8081
680+
routes:
681+
- destination:
682+
metadata:
683+
kind: GRPCRoute
684+
name: grpcroute-1
685+
namespace: default
686+
name: grpcroute/default/grpcroute-1/rule/0
687+
settings:
688+
- addressType: IP
689+
endpoints:
690+
- host: 7.7.7.7
691+
port: 8080
692+
metadata:
693+
kind: Service
694+
name: service-1
695+
namespace: default
696+
sectionName: "8080"
697+
name: grpcroute/default/grpcroute-1/rule/0/backend/0
698+
protocol: GRPC
699+
weight: 1
700+
hostname: '*'
701+
isHTTP2: true
702+
metadata:
703+
kind: GRPCRoute
704+
name: grpcroute-1
705+
namespace: default
706+
policies:
707+
- kind: BackendTrafficPolicy
708+
name: policy-for-gateway
709+
namespace: envoy-gateway
710+
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
711+
traffic:
712+
rateLimit:
713+
global:
714+
rules:
715+
- headerMatches:
716+
- distinct: false
717+
exact: one
718+
name: x-user-id
719+
- distinct: true
720+
name: x-org-id
721+
- distinct: false
722+
exact: admin
723+
invert: true
724+
name: x-org-id
725+
limit:
726+
requests: 10
727+
unit: Hour
728+
name: envoy-gateway/policy-for-gateway/rule/0
729+
pathMatch:
730+
distinct: false
731+
name: ""
732+
safeRegex: ^/user(/.*|\?.*|#.*|;.*|$)
525733
readyListener:
526734
address: 0.0.0.0
527735
ipFamily: IPv4

0 commit comments

Comments
 (0)