Skip to content

Commit

Permalink
pr: add golden test
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Jul 25, 2023
1 parent fe49a6d commit 8f2e621
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
_format_version: "3.0"
services:
- connect_timeout: 60000
host: httproute.default.test.0
name: httproute.default.test.0
protocol: http
read_timeout: 60000
retries: 5
routes:
- https_redirect_status_code: 426
name: httproute.default.test.0.0
path_handling: v0
paths:
- ~/test$
- /test/
preserve_host: true
protocols:
- http
- https
strip_path: true
tags:
- k8s-name:test
- k8s-namespace:default
- k8s-kind:HTTPRoute
- k8s-group:gateway.networking.k8s.io
- k8s-version:v1beta1
tags:
- k8s-name:test
- k8s-namespace:default
- k8s-kind:HTTPRoute
- k8s-group:gateway.networking.k8s.io
- k8s-version:v1beta1
write_timeout: 60000
upstreams:
- algorithm: round-robin
name: httproute.default.test.0
tags:
- k8s-name:test
- k8s-namespace:default
- k8s-kind:HTTPRoute
- k8s-group:gateway.networking.k8s.io
- k8s-version:v1beta1
targets:
- target: 10.244.0.5:9443
weight: 50
- target: 10.244.0.4:9443
weight: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
name: testing
namespace: other
spec:
from:
- group: gateway.networking.k8s.io
kind: HTTPRoute
namespace: default
to:
- group: ""
kind: Service
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: test
namespace: default
annotations:
konghq.com/strip-path: "true"
spec:
parentRefs:
- name: kong
rules:
- matches:
- path:
type: PathPrefix
value: /test
backendRefs:
- name: one
kind: Service
port: 80
weight: 50
group: ""
- name: two
namespace: other
kind: Service
port: 80
weight: 50
group: ""
---
apiVersion: v1
kind: Service
metadata:
labels:
app: example
name: one
namespace: default
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: example
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
labels:
app: example
name: two
namespace: other
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: example
type: ClusterIP
---
apiVersion: discovery.k8s.io/v1
addressType: IPv4
kind: EndpointSlice
metadata:
namespace: default
labels:
kubernetes.io/service-name: one
name: one-n5g6g
endpoints:
- addresses:
- 10.244.0.5
conditions:
ready: true
serving: true
terminating: false
ports:
- name: ""
port: 9443
protocol: TCP
---
apiVersion: discovery.k8s.io/v1
addressType: IPv4
kind: EndpointSlice
metadata:
namespace: other
labels:
kubernetes.io/service-name: two
name: two-n5g6g
endpoints:
- addresses:
- 10.244.0.4
conditions:
ready: true
serving: true
terminating: false
ports:
- name: ""
port: 9443
protocol: TCP

0 comments on commit 8f2e621

Please sign in to comment.