feat(charts): make HTTPRoute backendRefs optional per rule - #216
Merged
Conversation
The lago-rails and lago-front httproute templates always appended the default service backendRefs to every rule, which blocked rules ending in a terminal filter (DirectResponse via ExtensionRef, RequestRedirect) since those must render without backendRefs to be valid Gateway API. Switch to hasKey on .backendRefs: omitted keeps the previous default backend (back-compat with every existing values file), [] suppresses backendRefs entirely (for terminal filters), and an explicit list passes through for custom or weighted backends. backendRefs is optional in the Gateway API spec, so this just stops the chart from overriding that optionality.
IxDay
force-pushed
the
feat/httproute-backendrefs-hook
branch
from
June 26, 2026 08:14
99755d0 to
51e3850
Compare
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.
Summary
lago-railsandlago-frontalways appended the default servicebackendRefsto every rule in theirHTTPRoutetemplate. That blocked rules ending in a terminal filter (DirectResponseviaExtensionRef,RequestRedirect, etc.), since those must render without abackendRefsto be valid Gateway API.The change uses
hasKeyon.backendRefsper rule:backendRefs: []→ nobackendRefsrendered, for terminal-filter rulesHTTPRouteRule.backendRefsis optional in the Gateway API spec, so this just stops the chart from overriding that optionality.Motivation:
lago-infrastructureneeds to add a/metricsblock rule (DirectResponse 404 via Envoy Gateway'sHTTPRouteFilter) to thelago-apiHTTPRoute in staging-eu. Since that route is templated bylago-rails, the chart had to grow a hook for terminal filters.Test plan
helm template charts/lago-rails -f <values>withbackendRefs: []on a rule renders the rule with nobackendRefs:linebackendRefs: [{...}]renders the user backendsbackendRefskey renders the default service backend (back-compat)charts/lago-fronttask renderon the umbrellalagochart exits cleantask test:unitonceunttis available locally