Backport of (apigw/httproute) Add support to disable traffic with weight 0 in services into release/1.22.x#23305
Merged
sujay-hashicorp merged 1 commit intoMar 11, 2026
Conversation
github-team-consul-core-pr-approver
approved these changes
Mar 11, 2026
Collaborator
github-team-consul-core-pr-approver
left a comment
There was a problem hiding this comment.
Auto approved Consul Bot automated PR
sujay-hashicorp
approved these changes
Mar 11, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #23216 to be assessed for backporting due to the inclusion of the label backport/1.22.
The below text is copied from the body of the original PR.
Description
This PR fixes Consul API Gateway behavior for Kubernetes
HTTPRoutebackends withweight: 0.Previously,
HTTPRoutenormalization converted allweight <= 0values to1, which caused explicitweight: 0backends to still receive traffic. This conflicted with Gateway API expectations and customer-observed behavior.This change updates normalization logic to:
weight: 0(so zero-weight backends can be excluded from traffic).Links
Tests
weight: 0does not receive any traffic.HTTPRoute config output
$ consul config read -kind http-route -name quill-route{ "Kind": "http-route", "Name": "quill-route", "Parents": [ { "Kind": "api-gateway", "Name": "api-gateway", "SectionName": "http-listener" } ], "Rules": [ { "Filters": { "Headers": null, "URLRewrite": null, "RetryFilter": null, "TimeoutFilter": null, "JWT": null }, "ResponseFilters": { "Headers": null }, "Matches": [ { "Headers": null, "Method": "", "Path": { "Match": "prefix", "Value": "/" }, "Query": null } ], "Services": [ { "Name": "quill-v1", "Weight": 0, "Filters": { "Headers": null, "URLRewrite": null, "RetryFilter": null, "TimeoutFilter": null, "JWT": null }, "ResponseFilters": { "Headers": null } }, { "Name": "quill-v2", "Weight": 100, "Filters": { "Headers": null, "URLRewrite": null, "RetryFilter": null, "TimeoutFilter": null, "JWT": null }, "ResponseFilters": { "Headers": null } } ] } ], "Hostnames": null, "CreateIndex": 43, "ModifyIndex": 80, "Status": { "Conditions": [ { "Type": "Accepted", "Status": "True", "Reason": "Accepted", "Message": "route is valid", "Resource": { "Kind": "", "Name": "", "SectionName": "" }, "LastTransitionTime": "2026-02-16T08:17:57.943208Z" }, { "Type": "Bound", "Status": "True", "Reason": "Bound", "Message": "successfully bound route", "Resource": { "Kind": "api-gateway", "Name": "api-gateway", "SectionName": "http-listener" }, "LastTransitionTime": "2026-02-16T08:17:57.943215Z" } ] } }Traffic Distribution
case 1:
case 2:
PR Checklist
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.
Overview of commits