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
tao12345666333 and pmalek authored Jun 3, 2024
1 parent 8e0286f commit 84d97f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Adding a new version? You'll need three changes:
enabling the filter is recommended as soon as is convenient.
[#5856](https://github.com/Kong/kubernetes-ingress-controller/pull/5856)
- Dynamically set the proxy protocol of GRPCRoute to `grpc` or `grpcs` based on the port listened by Gateway.
If you don't set the protocol for Service via "konghq.com/protocol" annotation, Kong will use grpc instead of grpcs.
If you don't set the protocol for Service via "konghq.com/protocol" annotation, Kong will use `grpc` instead of `grpcs`.
[#5776](https://github.com/Kong/kubernetes-ingress-controller/pull/5776)

### Added
Expand Down Expand Up @@ -161,7 +161,7 @@ Adding a new version? You'll need three changes:
[#5965](https://github.com/Kong/kubernetes-ingress-controller/pull/5965)
- Fallback configuration no longer omits licenses and vaults.
[#6048](https://github.com/Kong/kubernetes-ingress-controller/pull/6048)
- Add support for pass Kubernetes Gateway API GRPCRoute conformance test.
- Add support for Gateway API GRPCRoute and pass related Gateway API conformance test.
[#5776](https://github.com/Kong/kubernetes-ingress-controller/pull/5776)

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion internal/dataplane/translator/translate_grpcroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ func grpcBackendRefsToBackendRefs(grpcBackendRef []gatewayapi.GRPCBackendRef) []
return backendRefs
}

// getProtocolForKongService returns the protocol for the Kong service based on the Gateway listening ports.
// getProtocolForKongService returns the protocol for the Kong service configuration.
// In order to get the protocol, provided route's parentRefs are searched for a Gateway that has the matching listening ports.
func (t *Translator) getProtocolForKongService(grpcRoute *gatewayapi.GRPCRoute) string {
// When Gateway listens on HTTP use "grpc" protocol for the service. Otherwise for HTTPS use "grpcs".
if len(t.getGatewayListeningPorts(grpcRoute.Namespace, gatewayapi.HTTPProtocolType, grpcRoute.Spec.ParentRefs)) > 0 {
Expand Down

0 comments on commit 84d97f7

Please sign in to comment.