Skip to content

tenant Gateway: two small ordering and gating items in the reconciler #4198

Open

Description

@kvaps

Split out of the review of #3342, carried as follow-ups. Two small items, both in internal/controller/tenantgateway/reconciler.go, neither urgent.

The recount gate declines to fix a false conflict the machinery is already there for. recount (reconciler.go:325-337) re-ranks ownership of a hostname over the plain routes plus whichever field it is given, and it runs only under if len(refused) > 0 (:341-344). So an ordinary race with no refusal keeps the original ranking, and that ranking is wrong for one shipped case: cert-manager's HTTP-01 solver route is published in the Gateway's own namespace with sectionName: http (renderers.go:823-825), so it counts as served-plain and enters the race; rankRouteRefs orders by namespace, and tenant-a sorts before tenant-a-child. A child tenant publishing a hostname therefore loses the race to the solver for the duration of every ACME challenge and reads Accepted=False with HostnameConflict, while its terminate listener is rendered and being served. The outcome is the same on the merge base, so this is a pre-existing symptom rather than a regression — but recount already does exactly the right thing, so it is one condition away. Either drop the gate for this case or leave a comment saying why the solver is allowed to win.

The withdrawal reads namespace state one pass before it establishes it. collectHostnameClaims runs at reconciler.go:187 and ensureNamespaceLabels at :652, so on the first reconcile after an entry is added to attachedNamespaces a route in that namespace is judged attachable while the Gateway's own selector does not yet admit it. It converges on the next pass, so the worst case is one pass of a status condition that is briefly wrong rather than anything served incorrectly — but a withdrawal decision taken from state the same function has not yet written is worth either reordering or naming in a comment.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    area/networkingIssues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn)
    triage/acceptedIndicates an issue is ready to be actively worked on
    priority/backlogGeneral backlog priority. Lower than priority/important-longterm
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/networkingIssues or PRs related to networking (ingress, gateway, vpn, metallb, kube-ovn)kind/bugCategorizes issue or PR as related to a bugpriority/backlogGeneral backlog priority. Lower than priority/important-longtermtriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions