Skip to content

Duplicated SectionName Expansion Logic #3811

@sarthyparty

Description

@sarthyparty

Describe the bug

The core issue lies in route_common.go:

  • Section name refs are expanded once during the build phase (buildSectionNameRefs) and then expanded again later when finding attachable listeners.
  • This double-expansion leads to inconsistent behavior and should be refactored so that section name refs are only expanded once, in a single, well-defined place.

Additional context

Several related inconsistencies appear to stem from this section name ref issue:

  1. Policies handling (policies.go L463)

    • The logic for merging listener hostnames with route hostnames does not properly handle wildcards.
    • AcceptedHostnames is currently a map of slices of strings, but we need to flatten it.
  2. ParentRefAttachmentStatus structure

    type ParentRefAttachmentStatus struct {
        AcceptedHostnames map[string][]string
        FailedConditions  []conditions.Condition
        ListenerPort      v1.PortNumber
        Attached          bool
    }
    • ListenerPort is modeled as a single port, but a ParentRef can attach to multiple listeners, each with different ports.
    • This mismatch may cause incorrect or incomplete status reporting.
  3. Refactoring difficulty

Summary

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtShort-term pain, long-term benefit

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions