fix(k8s): ingress render with both custom domains and additional ports - #255
Merged
Merged
Conversation
agustincelentano
approved these changes
Sep 10, 2026
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.
What
Scopes that have both a custom domain and additional ports failed on every deployment, at the step that builds the ingress manifest (
Failed to build ingress template). Bothinitial-ingressandblue-green-ingresswere affected. This fixes them.Why we want it
Any scope in that shape is undeployable — not degraded, blocked, with no workaround other than removing the custom domain or the extra ports. Both features work fine on their own, so it only bites the combination.
Criterion behind the fix
Inside
range .scope.capabilities.additional_ports, a nestedrangeover the scope's domains rebinds the dot, so.port/.typesilently pointed at a domain object instead of the port. The fix captures them into$port/$port_typebefore entering the nested loop.Two things I deliberately did not do:
.port. The.typeread next to it returned the domain's type, which is not an error — it quietly emittedgrpc, so HTTP additional ports would have pointed at a Service that does not exist, with nothing in the logs. Both fields had to be captured.$port/$port_type. Bare.portis correct everywhere the dot has not been rebound, and that is the convention these templates already follow; changing it would have churned ~30 correct lines.Testing
k8s/deployment/tests/ingress_domains_additional_ports.bats— renders both templates with two custom domains and two additional ports (one HTTP, one GRPC). Verified failing before the fix, passing after.Not in this PR
Two pre-existing bugs found while reviewing, each worth its own change: in
blue-green-ingress.yaml.tplthek8s_modifiersannotations block sits inside the HTTP/GRPC branch, so HTTP additional ports drop operator annotations; andhost:values are emitted as unquoted YAML scalars.