forked from kgateway-dev/kgateway
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sh/safe-ports-e2e
- Loading branch information
Showing
5 changed files
with
200 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
changelog: | ||
- type: FIX | ||
issueLink: https://github.com/k8sgateway/k8sgateway/issues/10379 | ||
resolvesIssue: false | ||
description: | | ||
There's a bug in how cycles are detected when evaluating a | ||
delegation chain, because of which a multi-level delegation | ||
tree with the same child route being referenced by multiple | ||
parent HTTP routes is broken. This change fixes the detection | ||
of cycles during the evaluation of the delegation chain. | ||
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
127 changes: 127 additions & 0 deletions
127
projects/gateway2/translator/testutils/inputs/delegation/bug-10379.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,127 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: example-gateway | ||
namespace: infra | ||
spec: | ||
gatewayClassName: example-gateway-class | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: api-example-com | ||
namespace: infra | ||
labels: | ||
app: apis | ||
spec: | ||
parentRefs: | ||
- name: example-gateway | ||
hostnames: | ||
- "api.example.com" | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /api1 | ||
backendRefs: | ||
- group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
name: apiproduct-1 | ||
namespace: default | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /api2 | ||
backendRefs: | ||
- group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
name: apiproduct-2 | ||
namespace: default | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: apiproduct-1 | ||
namespace: default | ||
labels: | ||
app: apis | ||
annotations: | ||
delegation.gateway.solo.io/inherit-parent-matcher: "true" | ||
spec: | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: / | ||
filters: | ||
- type: URLRewrite | ||
urlRewrite: | ||
path: | ||
type: ReplacePrefixMatch | ||
replacePrefixMatch: / | ||
backendRefs: | ||
- group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
name: httpbin | ||
namespace: default | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: apiproduct-2 | ||
namespace: default | ||
labels: | ||
app: apis | ||
annotations: | ||
delegation.gateway.solo.io/inherit-parent-matcher: "true" | ||
spec: | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: / | ||
filters: | ||
- type: URLRewrite | ||
urlRewrite: | ||
path: | ||
type: ReplacePrefixMatch | ||
replacePrefixMatch: / | ||
backendRefs: | ||
- group: gateway.networking.k8s.io | ||
kind: HTTPRoute | ||
name: httpbin | ||
namespace: default | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: httpbin | ||
namespace: default | ||
labels: | ||
app: apis | ||
annotations: | ||
delegation.gateway.solo.io/inherit-parent-matcher: "true" | ||
spec: | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: / | ||
backendRefs: | ||
- name: httpbin | ||
namespace: default | ||
port: 8000 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: httpbin | ||
namespace: default | ||
spec: | ||
ports: | ||
- protocol: TCP | ||
port: 8000 |
53 changes: 53 additions & 0 deletions
53
projects/gateway2/translator/testutils/outputs/delegation/bug-10379.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,53 @@ | ||
--- | ||
listeners: | ||
- aggregateListener: | ||
httpFilterChains: | ||
- matcher: {} | ||
virtualHostRefs: | ||
- http~api_example_com | ||
httpResources: | ||
virtualHosts: | ||
http~api_example_com: | ||
domains: | ||
- api.example.com | ||
name: http~api_example_com | ||
routes: | ||
- matchers: | ||
- prefix: /api1 | ||
name: httproute-httpbin-default-0-0 | ||
options: | ||
regexRewrite: | ||
pattern: | ||
regex: ^/api1\/* | ||
substitution: / | ||
routeAction: | ||
single: | ||
kube: | ||
port: 8000 | ||
ref: | ||
name: httpbin | ||
namespace: default | ||
- matchers: | ||
- prefix: /api2 | ||
name: httproute-httpbin-default-0-0 | ||
options: | ||
regexRewrite: | ||
pattern: | ||
regex: ^/api2\/* | ||
substitution: / | ||
routeAction: | ||
single: | ||
kube: | ||
port: 8000 | ||
ref: | ||
name: httpbin | ||
namespace: default | ||
bindAddress: '::' | ||
bindPort: 8080 | ||
name: http | ||
metadata: | ||
labels: | ||
created_by: gloo-kube-gateway-api | ||
gateway_namespace: infra | ||
name: infra-example-gateway | ||
namespace: gloo-system |