Skip to content

feat(gateway-api): support full ParentRef fields in HTTPRoute#394

Merged
tuunit merged 2 commits intooauth2-proxy:mainfrom
jmoosdijk:main
Mar 22, 2026
Merged

feat(gateway-api): support full ParentRef fields in HTTPRoute#394
tuunit merged 2 commits intooauth2-proxy:mainfrom
jmoosdijk:main

Conversation

@jmoosdijk
Copy link
Contributor

@jmoosdijk jmoosdijk commented Feb 25, 2026

Updated by @tuunit:

I repurposed the PR to do the following: Refactored the templating so that the whole object .Values.gatewayApi.gatewayRef gets templated toYaml instead of needing to maintain every possible current field of the GatewayAPI specification or future once.

https://gateway-api.sigs.k8s.io/reference/spec/#parentreference

This way we future proof the helm chart and have less maintenance on our side

Original PRs content:

Added the ability to configure what gateway-api listener the HTTPRoute should be attach to.

Description

Introduced the ability to configure gateway-api sectionName in values.yaml, allowing you to bind the HTTPRoute to a specific gateway-api listener (i.e. only a specific https listener).

When not configuring sectionName, the HTTPRoute is attached to all listeners on the specified gateway-api.

Checklist:

  • I have bumped the version in the Chart.yaml according to Semantic Versioning.
  • I have updated the documentation/CHANGELOG at the bottom of the Chart.yaml
  • I have signed off all my commits.
  • (Optional) I have updated the Chart.lock for dependency updates
  • (Optional) I have implemented helm tests for new feature flags

@pierluigilenoci
Copy link
Member

Hey, nice and clean PR! Two minor observations:

1. Changelog link mismatch
In Chart.yaml, the changelog entry points to #391 but this PR is #394. Is that intentional (e.g. referencing an earlier attempt), or should it be updated to point to this PR?

2. Helm test coverage
Would you consider adding a small Helm template test to verify that sectionName is rendered in the HTTPRoute when set, and omitted when left empty? Something along the lines of:

# tests/httproute_test.yaml
- it: should include sectionName when set
  set:
    gatewayApi.enabled: true
    gatewayApi.gatewayRef.name: my-gw
    gatewayApi.gatewayRef.sectionName: https
  asserts:
    - contains:
        path: spec.parentRefs
        content:
          sectionName: https
      any: true

- it: should not include sectionName when empty
  set:
    gatewayApi.enabled: true
    gatewayApi.gatewayRef.name: my-gw
  asserts:
    - notContains:
        path: spec.parentRefs
        content:
          sectionName: ""
      any: true

This would help prevent regressions and is consistent with the testing patterns for similar optional fields. Not a blocker, but a nice-to-have!

{{- end }}
spec:
{{- if .Values.gatewayApi.gatewayRef.name }}
parentRefs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mhhh maybe we should take the opportunity and refactor to support any future option for the parent reference?

so instead of each parameter needing to be part of our chart we should do:

  parentRefs:
  - {{ toYaml .Values.gatewayApi.gatewayRef | nindent 4 | trim }}

https://gateway-api.sigs.k8s.io/reference/spec/#parentreference

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pierluigilenoci what's your opinion on this? this would mean less maintenance effort on our end for the chart and we would automatically support all reference options

Copy link
Member

@pierluigilenoci pierluigilenoci Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree with you here. Passing the whole gatewayRef through with toYaml would reduce maintenance effort on our side and automatically support any future parentReference fields without needing chart changes every time the Gateway API spec evolves. Much cleaner approach.

@tuunit tuunit changed the title feat: ability to configure gateway-api listener to bind to feat: full support for ParentRef fields of gateway-api HTTPRoutes Mar 22, 2026
Signed-off-by: Jarno van de Moosdijk <jarnovandemoosdijk@gmail.com>
tuunit
tuunit previously approved these changes Mar 22, 2026
Copy link
Member

@tuunit tuunit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmoosdijk thank you for bringing this up but as suggested by me and Pier we decided to take the opportunity to future proof it and instead just template the whole gatewayRef block as one

Signed-off-by: Jan Larwig <jan@larwig.com>
@tuunit tuunit changed the title feat: full support for ParentRef fields of gateway-api HTTPRoutes feat: full support for ParentReference fields inside HTTPRoutes Mar 22, 2026
@tuunit tuunit changed the title feat: full support for ParentReference fields inside HTTPRoutes feat(gateway-api): support full ParentRef fields in HTTPRoute Mar 22, 2026
@tuunit tuunit merged commit 0c00c57 into oauth2-proxy:main Mar 22, 2026
2 checks passed
@jmoosdijk
Copy link
Contributor Author

@jmoosdijk thank you for bringing this up but as suggested by me and Pier we decided to take the opportunity to future proof it and instead just template the whole gatewayRef block as one

my pleasure, better to future-proof it indeed!

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.

4 participants