feat: add listenerset - #24993
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
thanks for putting this together — nice that you validated end-to-end against kgateway in the description. a few things i'd want addressed before this merges: bugs
gaps
Comment posted by Coder Agents on behalf of @bpmct |
|
Hi @bpmct, thanks for the review.
fixed.
Added
fixed.
fixed.
I've never written Helm tests before. If they're needed, I'll take a closer look.
done.
I don't agree with that, since these two resources belong together. However, if you'd still like me to, I can put the redirect route in a separate file. |
|
Thanks! Giving this a shot on my machine now, then will likely flag for someone else on the dev team to review too! |
|
Hi @bpmct, any updates? |
rowansmithau
left a comment
There was a problem hiding this comment.
hey @0xmeyer thanks for the contribution. I've added some review notes if you could take a look at those please.
on the tests, if you take a look at https://github.com/coder/coder/blob/main/helm/coder/tests/testdata/host_aliases.yaml (and the others in that directory) you will get an idea of the required structure. those test files are used to generate the .golden files which are used across version/code changes for comparison.
1. Remove parentRefs required validation for httproute — parentRefs are optional per the Gateway API spec and enforcing them is a breaking change for existing users. 2. Add listeners required validation for listenerset — listeners is required per the ListenerSet spec and omitting it only surfaces at apply time with a confusing error.
rowansmithau
left a comment
There was a problem hiding this comment.
the two issues were resolved, thanks.
I ran the CI but it looks to me like the failures are unrelated to this PR.
Now we just need some tests added.
I tested locally with:
helm template coder . \
--set coder.image.tag=v2.34.2 \
--set coder.httproute.enable=true \
--set "coder.httproute.parentRefs[0].name=fake-gateway" \
--set "coder.httproute.parentRefs[0].namespace=fake-ns" \
--set coder.httproute.host=coder.example.com \
--set coder.listenerset.enable=true \
--set "coder.listenerset.parentRef.name=fake-gateway" \
--set "coder.listenerset.parentRef.namespace=fake-ns" \
--set "coder.listenerset.listeners[0].name=https" \
--set "coder.listenerset.listeners[0].port=443" \
--set "coder.listenerset.listeners[0].protocol=HTTPS"
and:
helm template coder . \
--set coder.image.tag=v2.34.2 \
--set coder.httproute.enable=true \
--set "coder.httproute.parentRefs[0].name=fake-gateway" \
--set "coder.httproute.parentRefs[0].namespace=fake-ns" \
--set coder.httproute.host=coder.example.com \
--set coder.httproute.httpsRedirect.enable=true \
--set "coder.httproute.httpsRedirect.parentRefs[0].name=fake-gateway" \
--set "coder.httproute.httpsRedirect.parentRefs[0].port=80" \
--set coder.listenerset.enable=true \
--set "coder.listenerset.parentRef.name=fake-gateway" \
--set "coder.listenerset.parentRef.namespace=fake-ns" \
--set "coder.listenerset.listeners[0].name=https" \
--set "coder.listenerset.listeners[0].port=443" \
--set "coder.listenerset.listeners[0].protocol=HTTPS" \
--set "coder.listenerset.listeners[1].name=http" \
--set "coder.listenerset.listeners[1].port=80" \
--set "coder.listenerset.listeners[1].protocol=HTTP"
they are probably the ideal params to build a test around (like https://github.com/coder/coder/blob/main/helm/coder/tests/testdata/tls.yaml as an example)
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.8.0 | Round 1 | Last posted: Round 1, 2 findings (1 P2, 1 Nit), COMMENT. Review Finding inventoryFinding InventoryFindings
Round logRound 1Netero-only. 1 P2, 1 Nit. Reviewed against 3c3708f..db0dcc8. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
This is a first-pass review only. These are mechanical findings; the full review panel has not yet reviewed this PR. The panel will review after these findings are addressed.
This PR adds Gateway API ListenerSet support and HTTPS redirect to the Helm chart. The implementation is clean: validation checks with clear error messages, correct API version targeting, and the template structure renders valid YAML. The author's end-to-end validation against kgateway is thorough.
Severity summary: 1 P2, 1 Nit.
The chart has 30+ golden file test fixtures covering every other feature (TLS, service accounts, ingress, host aliases, etc.). The new ListenerSet template and HTTPS redirect route add 64 lines of template logic with 3 validation checks at 0% test density. Both human reviewers (@rowansmithau and @bpmct) also flagged this gap.
🤖 This review was automatically generated with Coder Agents.
| @@ -0,0 +1,28 @@ | |||
| {{- if and .Values.coder.listenerset.enable (empty .Values.coder.listenerset.parentRef) -}} | |||
There was a problem hiding this comment.
P2 [CRF-1] No golden file test cases for the new ListenerSet template or the HTTPS redirect HTTPRoute.
The chart's test infrastructure in helm/coder/tests/ uses values YAML fixtures with golden file comparison. There are 30+ test cases covering other features, verified by:
grep -rl 'listenerset\|httpsRedirect\|ListenerSet\|https-redirect' helm/coder/tests/testdata/
# (no results)
This template has 3 fail validation checks and multi-document rendering (the redirect route shares a template with the main HTTPRoute). At minimum, two test fixtures would cover the core paths:
- listenerset.yaml:
listenerset.enable=truewith requiredparentRefandlisteners - httproute_redirect.yaml:
httproute.enable=true+httpsRedirect.enable=truewith requiredparentRefs
@rowansmithau provided ready-to-use helm template invocations in their second review that map directly to test fixtures. See helm/coder/tests/testdata/tls.yaml for the structure. (Netero)
🤖
Add two test cases matching the scenarios from review: 1. listenerset — enables ListenerSet + HTTPRoute with parentRefs 2. listenerset_redirect — adds HTTPS redirect HTTPRoute on top Each generates golden files for both default and coder namespaces, consistent with the existing test suite (tls, host_aliases, etc.).
|
Added golden-file tests in c6a2915 covering both scenarios from your review:
Each generates golden files for both Comment posted by Coder Agents on behalf of @bpmct |
Adds support for Gateway API ListenerSet.
This PR was validated using
kgateway-v2.3.0-mainusing the following values:Validate: