Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Patryk Małek <[email protected]>
  • Loading branch information
randmonkey and pmalek authored Dec 17, 2024
1 parent b8f9d47 commit 5e7a3ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ Adding a new version? You'll need three changes:
a FQDN with a default cluster domain of `""`.
Users can override the default by setting the `--cluster-domain` flag.
[#6697](https://github.com/Kong/kubernetes-ingress-controller/pull/6697)
- Translate `RequestRedirect` HTTPRoute filter to `redirect` plugin if Kong
gateway supports (Kong gateway with version >= 3.9.0). This safisfies the
specification of preserving paths in redirect response from the request.
- Translate `RequestRedirect` HTTPRoute filter to `redirect` plugin if supported
by Kong gateway supports (Kong gateway with version >= 3.9.0). This satisfies
the Gateway API specification of preserving paths in redirect response from
the request.
The target port of redirect is set to empty when the `port` of the filter is
not given for remaining the port in the request for the conformance with
gateway API specification. This changed the behavior in the previous versions
gateway API specification. This changed the behavior from previous versions
of using port `80` as the redirect target when `port` is not given. It will
break the uncommon usage of using `https` scheme and empty `port` in the
break some uncommon use cases of using `https` scheme and empty `port` in the
filter while intending to redirect the requests to HTTPS service in port 80.
For such usage, please explicitly specify the `port` to `80` in the filter.
[#6804](https://github.com/Kong/kubernetes-ingress-controller/pull/6804)
Expand Down
1 change: 0 additions & 1 deletion internal/dataplane/translator/subtranslator/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,6 @@ func generateRequestRedirectUsingRedirectKongPlugin(
} else {
location = path
}
fmt.Println("==== ", location)
redirectPlugin.Config["location"] = kong.String(location)
redirectPlugin.Config["keep_incoming_path"] = kong.Bool(preservePath)

Expand Down
1 change: 1 addition & 0 deletions internal/dataplane/translator/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type FeatureFlags struct {
// that are sharing the same combination of backends to one Kong service.
CombinedServicesFromDifferentHTTPRoutes bool
// SupportRedirectPlugin indicates whether the Kong gateway supports the `redirect` plugin.
// This is supported starting with Kong 3.9.
// If `redirect` plugin is supported, we will translate the `requestRedirect` filter to `redirect` plugin
// so preserving paths of request in the redirect response can be supported.
SupportRedirectPlugin bool
Expand Down

0 comments on commit 5e7a3ad

Please sign in to comment.