Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ Adding a new version? You'll need three changes:

### Fixed

- Set `protocols` field to `[http,https]` in translated routes in expression
router mode.
[#7860](https://github.com/Kong/kubernetes-ingress-controller/pull/7860)

- Fixed an issue with SNI generation in dbless mode.
[#7853](https://github.com/Kong/kubernetes-ingress-controller/pull/7853)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ services:
name: grpcroute.default.grpcbin.example.com.2.0
preserve_host: true
priority: 26766487871743
protocols:
- http
- https
tags:
- k8s-name:grpcbin
- k8s-namespace:default
Expand Down Expand Up @@ -54,6 +57,9 @@ services:
name: grpcroute.default.grpcbin.example.com.1.0
preserve_host: true
priority: 26766487904511
protocols:
- http
- https
tags:
- k8s-name:grpcbin
- k8s-namespace:default
Expand Down Expand Up @@ -89,6 +95,9 @@ services:
name: grpcroute.default.grpcbin.example.com.0.0
preserve_host: true
priority: 26766487929087
protocols:
- http
- https
tags:
- k8s-name:grpcbin
- k8s-namespace:default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ services:
name: httproute.default.httproute-testing._.3.0
preserve_host: true
priority: 35184414035967
protocols:
- http
- https
strip_path: true
tags:
- k8s-name:httproute-testing
Expand Down Expand Up @@ -43,6 +46,9 @@ services:
name: httproute.default.httproute-testing._.2.0
preserve_host: true
priority: 35184430813183
protocols:
- http
- https
strip_path: true
tags:
- k8s-name:httproute-testing
Expand All @@ -57,6 +63,9 @@ services:
name: httproute.default.httproute-testing._.1.0
preserve_host: true
priority: 35184405647359
protocols:
- http
- https
strip_path: true
tags:
- k8s-name:httproute-testing
Expand Down Expand Up @@ -86,6 +95,9 @@ services:
name: httproute.default.httproute-testing._.0.0
preserve_host: true
priority: 35184514699263
protocols:
- http
- https
strip_path: true
tags:
- k8s-name:httproute-testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ services:
- k8s-version:v1
preserve_host: true
priority: 35184422424575
protocols:
- http
- https
strip_path: false
tags:
- k8s-name:httproute-testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.foo.foo-svc.example.com.80
preserve_host: true
priority: 57178899611649
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.foo.foo-svc.example.net.8000
preserve_host: true
priority: 57178899611649
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down Expand Up @@ -49,6 +52,9 @@ services:
name: foo-namespace.foo.foo-svc.example.com.80
preserve_host: true
priority: 57178899611649
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.regex-prefix.foo-svc.example.com.http
preserve_host: true
priority: 57178899611649
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.foo.foo-svc.example.com.80
preserve_host: true
priority: 57178899677193
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.regex-prefix.foo-svc.example.com.80
preserve_host: true
priority: 57178899677194
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ services:
name: bar-namespace.ing-with-tls.foo-svc.example.com.80
preserve_host: true
priority: 57178899677185
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ services:
name: bar-namespace.ing-with-tls.foo-svc.example.com.80
preserve_host: true
priority: 57178899677185
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.foo.foo-svc.example.com.80
preserve_host: true
priority: 57178899677185
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand All @@ -31,6 +34,9 @@ services:
name: foo-namespace.foo-2.foo-svc.example.com.80
preserve_host: true
priority: 57178899677185
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.foo.cert-manager-solver-pod.example.com.80
preserve_host: true
priority: 57178899611680
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
name: foo-namespace.foo.foo-svc.example.com.80
preserve_host: true
priority: 57178899677185
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down Expand Up @@ -47,6 +50,9 @@ services:
name: bar-namespace.ing-with-default-backend
preserve_host: true
priority: 0
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ services:
name: default.beta
preserve_host: true
priority: 0
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down Expand Up @@ -67,6 +70,9 @@ services:
name: default.beta..svc-facade-beta.svc.facade
preserve_host: true
priority: 54975581454341
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down Expand Up @@ -99,6 +105,9 @@ services:
name: default.alpha..svc-facade-alpha.svc.facade
preserve_host: true
priority: 54975581454342
protocols:
- http
- https
request_buffering: true
response_buffering: true
strip_path: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func GenerateKongExpressionRoutesFromGRPCRouteRule(grpcroute *gatewayapi.GRPCRou
r := kongstate.Route{
Ingress: ingressObjectInfo,
Route: kong.Route{
Name: kong.String(routeName),
Name: kong.String(routeName),
Protocols: kong.StringSlice("http", "https"),
},
ExpressionRoutes: true,
}
Expand All @@ -62,7 +63,8 @@ func GenerateKongExpressionRoutesFromGRPCRouteRule(grpcroute *gatewayapi.GRPCRou
r := kongstate.Route{
Ingress: ingressObjectInfo,
Route: kong.Route{
Name: kong.String(routeName),
Name: kong.String(routeName),
Protocols: kong.StringSlice("http", "https"),
},
ExpressionRoutes: true,
}
Expand Down Expand Up @@ -475,6 +477,7 @@ func KongExpressionRouteFromSplitGRPCRouteMatchWithPriority(
r := kongstate.Route{
Route: kong.Route{
Name: kong.String(routeName),
Protocols: kong.StringSlice("http", "https"),
PreserveHost: kong.Bool(true),
Tags: tags,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
ExpressionRoutes: true,
Route: kong.Route{
Name: kong.String("grpcroute.default.single-match.0.0"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`(http.path ^= "/service0/") && (http.headers.x_foo == "Bar")`),
Priority: kong.Uint64(1),
},
Expand Down Expand Up @@ -89,6 +90,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
ExpressionRoutes: true,
Route: kong.Route{
Name: kong.String("grpcroute.default.single-match-with-hostname.0.0"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`(http.path == "/service0/method0") && ((http.host == "foo.com") || (http.host =^ ".foo.com"))`),
Priority: kong.Uint64(1),
},
Expand Down Expand Up @@ -134,6 +136,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
ExpressionRoutes: true,
Route: kong.Route{
Name: kong.String("grpcroute.default.multiple-matches.0.0"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`(http.path =^ "/method0") && ((http.headers.client == "kong-test") && (http.headers.version == "2"))`),
Priority: kong.Uint64(1),
},
Expand All @@ -147,6 +150,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
ExpressionRoutes: true,
Route: kong.Route{
Name: kong.String("grpcroute.default.multiple-matches.0.1"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`http.path ~ "^/v[012]/.+"`),
Priority: kong.Uint64(1),
},
Expand Down Expand Up @@ -186,6 +190,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
ExpressionRoutes: true,
Route: kong.Route{
Name: kong.String("grpcroute.default.single-match-with-annotations.0.0"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`(http.path == "/service0/method0") && (tls.sni == "kong.foo.com")`),
Priority: kong.Uint64(1),
},
Expand All @@ -209,6 +214,7 @@ func TestGenerateKongExpressionRoutesFromGRPCRouteRule(t *testing.T) {
ExpressionRoutes: true,
Route: kong.Route{
Name: kong.String("grpcroute.default.hostname-only.0.0"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`http.host == "foo.com"`),
Priority: kong.Uint64(1),
},
Expand Down Expand Up @@ -1118,6 +1124,7 @@ func TestKongExpressionRouteFromSplitGRPCRouteWithPriority(t *testing.T) {
expectedRoute: kongstate.Route{
Route: kong.Route{
Name: kong.String("grpcroute.default.no-hostname-exact-method._.0.0"),
Protocols: kong.StringSlice("http", "https"),
PreserveHost: kong.Bool(true),
Expression: kong.String(`http.path == "/pets/list"`),
Priority: kong.Uint64(1 << 14),
Expand Down Expand Up @@ -1170,6 +1177,7 @@ func TestKongExpressionRouteFromSplitGRPCRouteWithPriority(t *testing.T) {
expectedRoute: kongstate.Route{
Route: kong.Route{
Name: kong.String("grpcroute.default.precise-hostname-regex-method.foo.com.0.0"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`(http.path ~ "^/name/[a-z0-9]+") && (http.host == "foo.com")`),
PreserveHost: kong.Bool(true),
Priority: kong.Uint64((1 << 31) + 1),
Expand Down Expand Up @@ -1239,6 +1247,7 @@ func TestKongExpressionRouteFromSplitGRPCRouteWithPriority(t *testing.T) {
expectedRoute: kongstate.Route{
Route: kong.Route{
Name: kong.String("grpcroute.default.wildcard-hostname-header-match._.foo.com.0.1"),
Protocols: kong.StringSlice("http", "https"),
Expression: kong.String(`(http.path ^= "/name/") && (http.headers.foo == "bar") && (http.host =^ ".foo.com")`),
PreserveHost: kong.Bool(true),
Priority: kong.Uint64((1 << 42) + 1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ func kongExpressionRouteFromHTTPRouteMatchWithPriority(
Route: kong.Route{
Name: kong.String(routeName),
PreserveHost: kong.Bool(true),
Protocols: kong.StringSlice("http", "https"),
// stripPath needs to be disabled by default to be conformant with the Gateway API
StripPath: kong.Bool(false),
Tags: tags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ func TestKongExpressionRouteFromHTTPRouteMatchWithPriority(t *testing.T) {

require.NoError(t, err)
require.Equal(t, tc.routeName, *route.Name, "Should have expected route name")
require.ElementsMatch(t, lo.ToSlicePtr([]string{"http", "https"}), route.Protocols)
require.True(t, route.ExpressionRoutes, "Should be expression route")
require.Equal(t, tc.routeExpresion, *route.Expression, "Should translate to expected expression")
require.Equal(t, tc.priority, *route.Priority, "Should have expected priority")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (m *ingressTranslationMeta) translateIntoKongExpressionRoute() *kongstate.R
Ingress: util.FromK8sObject(m.parentIngress),
Route: kong.Route{
Name: kong.String(routeName),
Protocols: kong.StringSlice("http", "https"),
StripPath: kong.Bool(false),
PreserveHost: kong.Bool(true),
RequestBuffering: kong.Bool(true),
Expand Down
Loading
Loading