Skip to content

fix: stale route status after the parent Gateway is modified - #5116

Open
yuehaii wants to merge 1 commit into
kubernetes-sigs:mainfrom
yuehaii:stale-route-status
Open

fix: stale route status after the parent Gateway is modified#5116
yuehaii wants to merge 1 commit into
kubernetes-sigs:mainfrom
yuehaii:stale-route-status

Conversation

@yuehaii

@yuehaii yuehaii commented Jul 27, 2026

Copy link
Copy Markdown

What type of PR is this?
/kind bug

What this PR does / why we need it:
The RouteStatus spec previously used 'should' update (non-normative) when describing that implementations must update status.parents[].conditions on an HTTPRoute after the parent Gateway is modified. This left room for implementations to leave stale route status behind. For example, when a Gateway listener hostname is updated to match an HTTPRoute's hostname, the route's Accepted=False / NoMatchingListenerHostname condition could remain unchanged even though the route should now be accepted.

This PR:

  1. Strengthens the spec language from should update to MUST update in RouteStatus (apis/v1/shared_types.go), making the requirement
    normative.
  2. Adds a conformance test (GatewayUpdateListenerHostname) that verifies an HTTPRoute's status.parents[].conditions is updated from
    Accepted=False / NoMatchingListenerHostname to Accepted=True / Accepted after the Gateway listener hostname is changed to match the
    route's hostname.

Which issue(s) this PR fixes:
Fixes #5115

Does this PR introduce a user-facing change?:
None


Signed-off-by: hai.yue <20416005+yuehaii@users.noreply.github.com>
@kubernetes-prow

Copy link
Copy Markdown

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 27, 2026
@kubernetes-prow

Copy link
Copy Markdown

@yuehaii: The label(s) kind/conformance cannot be applied, because the repository doesn't have them.

Details

In response to this:

What type of PR is this?
/kind conformance bug

What this PR does / why we need it:
The RouteStatus spec previously used 'should' update (non-normative) when describing that implementations must update status.parents[].conditions on an HTTPRoute after the parent Gateway is modified. This left room for implementations to leave stale route status behind. For example, when a Gateway listener hostname is updated to match an HTTPRoute's hostname, the route's Accepted=False / NoMatchingListenerHostname condition could remain unchanged even though the route should now be accepted.

This PR:

  1. Strengthens the spec language from should update to MUST update in RouteStatus (apis/v1/shared_types.go), making the requirement
    normative.
  2. Adds a conformance test (GatewayUpdateListenerHostname) that verifies an HTTPRoute's status.parents[].conditions is updated from
    Accepted=False / NoMatchingListenerHostname to Accepted=True / Accepted after the Gateway listener hostname is changed to match the
    route's hostname.

Which issue(s) this PR fixes:
Fixes #5115

Does this PR introduce a user-facing change?:
None


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yuehaii
Once this PR has been reviewed and has the lgtm label, please assign rikatz for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow

Copy link
Copy Markdown

Welcome @yuehaii!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow

Copy link
Copy Markdown

Hi @yuehaii. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 27, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from howardjohn and rikatz July 27, 2026 08:12
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 27, 2026
Comment thread apis/v1/shared_types.go
// each parent. When this route attaches to a parent, the controller that
// manages the parent must add an entry to this list when the controller
// first sees the route and should update the entry as appropriate when the
// first sees the route and MUST update the entry as appropriate when the

@snorwin snorwin Jul 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuehaii could you bring this topic to one of our community meetings? (https://gateway-api.sigs.k8s.io/contributing/get-involved/#meetings) I would consider this a breaking change for implementations, so I think it's important that the community discusses and agrees on it first before we move forward.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. I have added a topic in [SIG-NETWORK] Gateway API Meeting Notes for discussion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuehaii we discussed this PR quickly in today's community meeting. We are mostly in agreement with the proposed tightening of the API spec. However, since this is a breaking change, we would like to get a better understanding of how many implementations would be impacted before moving forward.

Could you also share how you encountered this issue, and are you aware of any implementations that aren't behaving as you expected?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this update, as tested by the included test, is probably okay.

But is also important to call out that there are some cases where there is more to it - particularly when a Route falls out of scope. In that case, the controller may not see updates to the Route (if it's screening out Routes that aren't relevant on each Gateway reconciliation). That's probably better handled as a separate issue though.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your help on the community meeting, @snorwin . please check this envoy gateway issue envoyproxy/gateway#8876, I am still working on an elegant fix.

@sjberman

sjberman commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

I've verified that this tests passes with NGINX, so no breakage for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix/conformance: HTTPRoute status did not update after Gateway listener hostname change

4 participants