refactor(gateway-xds): remove or wire unused defaultCluster parameter in createRoute
@renuka-fernando is already working on this.
Since May 31, 2026.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Summary
The createRoute function in gateway/gateway-controller/pkg/xds/translator.go accepts a defaultCluster parameter, but the parameter is not used when building the Envoy RouteAction. As a result, routes emitted with useClusterHeader=true are pure cluster_header routes with no fallback cluster, meaning requests that do not carry the x-target-upstream header (i.e., those without a dynamic-endpoint policy) will not fall back to the intended default cluster (e.g., the sandbox cluster).
Context
This was identified during the review of #2059, which introduced sandbox dynamic-cluster routing. The sbDefaultCluster value (the sandbox cluster name) is computed and passed into createRoute, but the function does not emit it into the route. The team has acknowledged this and intends to address it in a follow-up PR.
See: https://github.com/wso2/api-platform/pull/2059#discussion_r3329716770
Affected files
gateway/gateway-controller/pkg/xds/translator.go—createRoutefunction and callers intranslateAPIConfiggateway/gateway-controller/pkg/transform/restapi.go— parallelTransformpath for sandbox routes
Suggested action
Either:
- Wire
defaultClusterinto the emitted Envoy route action so requests without a dynamic-endpoint policy fall back to the specified cluster, or - Remove the
defaultClusterparameter entirely if a fallback is not needed and document the expected behavior.
Requested by @renuka-fernando.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.