Skip to content

fix(helpers): render zero weight and backendRef filters in HTTPRoute - #615

Open
aslafy-z wants to merge 1 commit into
mainfrom
fix/httproute-weight-filters
Open

fix(helpers): render zero weight and backendRef filters in HTTPRoute#615
aslafy-z wants to merge 1 commit into
mainfrom
fix/httproute-weight-filters

Conversation

@aslafy-z

@aslafy-z aslafy-z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes #613. Follow-up to #603, fixing the two defects in the application.httpRoute.rules helper.

What changed

weight: 0 is now rendered. The renderer guarded weight with a truthiness check ({{- if .weight }}), so an explicit weight: 0 was omitted from the manifest. Since the Gateway API defaults an omitted weight to 1, a backend drained with weight: 0 kept receiving traffic. The guard is now a presence check, with the same empty-templated-value handling as port.

Per-backendRef filters are passed through. The backendRef renderer was a field whitelist (name, port, weight, namespace, kind, group), so HTTPBackendRef.filters validated against the schema but never reached the manifest. A toYaml passthrough now renders it, matching the existing rule-level matches/filters/timeouts handling.

Validation

  • Three new helm-unittest cases: explicit weight: 0, empty templated weight treated as unset, and per-backendRef filters passthrough.
  • Full suite passes (398 tests, 32 suites) and helm lint is clean.
  • Confirmed the issue's repro with a live helm template render: weight: 0 and the RequestHeaderModifier filter now appear on the rendered backendRef.

@aslafy-z
aslafy-z requested a review from rasheedamir as a code owner August 19, 2026 14:26
@aslafy-z
aslafy-z force-pushed the fix/httproute-weight-filters branch from f4ac4e9 to 2ff5861 Compare August 19, 2026 14:28
@aslafy-z
aslafy-z force-pushed the fix/httproute-weight-filters branch from 2ff5861 to 9691888 Compare August 19, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTPRoute rules helper drops zero weight and backendRef filters

1 participant