-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not prepend ~ before regex paths for Kong < 3.0 (#4238)
* fix: do not prepend ~ before regex paths for Kong < 3.0 * add tests for translating grpcroute * add CHANGELOG
- Loading branch information
1 parent
d73df77
commit 1b59a9b
Showing
8 changed files
with
217 additions
and
10 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
42 changes: 42 additions & 0 deletions
42
internal/dataplane/parser/testdata/golden/grpcroute-example/default_golden.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,42 @@ | ||
_format_version: "3.0" | ||
services: | ||
- connect_timeout: 60000 | ||
host: grpcroute.default.grpcbin.0 | ||
name: grpcroute.default.grpcbin.0 | ||
plugins: | ||
- config: | ||
message: no existing backendRef provided | ||
status_code: 500 | ||
name: request-termination | ||
protocol: grpcs | ||
read_timeout: 60000 | ||
retries: 5 | ||
routes: | ||
- hosts: | ||
- example.com | ||
https_redirect_status_code: 426 | ||
name: grpcroute.default.grpcbin.0.0 | ||
path_handling: v0 | ||
paths: | ||
- ~/grpcbin.GRPCBin/DummyUnary | ||
protocols: | ||
- grpc | ||
- grpcs | ||
tags: | ||
- k8s-name:UNKNOWN | ||
- k8s-namespace:UNKNOWN | ||
- k8s-kind:Service | ||
- k8s-uid:00000000-0000-0000-0000-000000000000 | ||
- k8s-group:core | ||
- k8s-version:v1 | ||
write_timeout: 60000 | ||
upstreams: | ||
- algorithm: round-robin | ||
name: grpcroute.default.grpcbin.0 | ||
tags: | ||
- k8s-name:UNKNOWN | ||
- k8s-namespace:UNKNOWN | ||
- k8s-kind:Service | ||
- k8s-uid:00000000-0000-0000-0000-000000000000 | ||
- k8s-group:core | ||
- k8s-version:v1 |
33 changes: 33 additions & 0 deletions
33
internal/dataplane/parser/testdata/golden/grpcroute-example/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,33 @@ | ||
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: GRPCRoute | ||
metadata: | ||
name: grpcbin | ||
namespace: default | ||
spec: | ||
parentRefs: | ||
- name: kong | ||
hostnames: | ||
- "example.com" | ||
rules: | ||
- backendRefs: | ||
- name: grpcbin | ||
port: 443 | ||
matches: | ||
- method: | ||
service: "grpcbin.GRPCBin" | ||
method: "DummyUnary" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: grpcbin | ||
namespace: default | ||
labels: | ||
app: grpcbin | ||
spec: | ||
ports: | ||
- name: grpc | ||
port: 443 | ||
targetPort: 9001 | ||
selector: | ||
app: grpcbin |
42 changes: 42 additions & 0 deletions
42
...rnal/dataplane/parser/testdata/golden/grpcroute-example/regex-path-prefix-off_golden.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,42 @@ | ||
_format_version: "3.0" | ||
services: | ||
- connect_timeout: 60000 | ||
host: grpcroute.default.grpcbin.0 | ||
name: grpcroute.default.grpcbin.0 | ||
plugins: | ||
- config: | ||
message: no existing backendRef provided | ||
status_code: 500 | ||
name: request-termination | ||
protocol: grpcs | ||
read_timeout: 60000 | ||
retries: 5 | ||
routes: | ||
- hosts: | ||
- example.com | ||
https_redirect_status_code: 426 | ||
name: grpcroute.default.grpcbin.0.0 | ||
path_handling: v0 | ||
paths: | ||
- /grpcbin.GRPCBin/DummyUnary | ||
protocols: | ||
- grpc | ||
- grpcs | ||
tags: | ||
- k8s-name:UNKNOWN | ||
- k8s-namespace:UNKNOWN | ||
- k8s-kind:Service | ||
- k8s-uid:00000000-0000-0000-0000-000000000000 | ||
- k8s-group:core | ||
- k8s-version:v1 | ||
write_timeout: 60000 | ||
upstreams: | ||
- algorithm: round-robin | ||
name: grpcroute.default.grpcbin.0 | ||
tags: | ||
- k8s-name:UNKNOWN | ||
- k8s-namespace:UNKNOWN | ||
- k8s-kind:Service | ||
- k8s-uid:00000000-0000-0000-0000-000000000000 | ||
- k8s-group:core | ||
- k8s-version:v1 |
2 changes: 2 additions & 0 deletions
2
...al/dataplane/parser/testdata/golden/grpcroute-example/regex-path-prefix-off_settings.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,2 @@ | ||
feature_flags: | ||
RegexPathPrefix: false |
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
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
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