Skip to content

feat(httproute): add optional kind and group fields to parentRefs#349

Open
pierre-jezegou wants to merge 4 commits into
opencost:mainfrom
pierre-jezegou:feat/httproute-parentrefs-kind-group
Open

feat(httproute): add optional kind and group fields to parentRefs#349
pierre-jezegou wants to merge 4 commits into
opencost:mainfrom
pierre-jezegou:feat/httproute-parentrefs-kind-group

Conversation

@pierre-jezegou

@pierre-jezegou pierre-jezegou commented May 10, 2026

Copy link
Copy Markdown

Add kind and group to HTTPRoute parentRefs

Required to support ListenerSet as a parent resource for HTTPRoute, promoted to Standard channel in Gateway API v1.5
See https://gateway-api.sigs.k8s.io/guides/listener-set/

Changes

  • Add optional kind and group fields in httproute.yaml (ui, api, mcp)
  • Add them as commented fields in values.yaml (defaults to kind: Gateway)

Copilot AI review requested due to automatic review settings May 10, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for Gateway API v1.5 ListenerSet (and other non-default parent resources) by allowing kind and group to be specified on HTTPRoute.spec.parentRefs in the OpenCost Helm chart.

Changes:

  • Extend HTTPRoute templates to optionally render parentRefs[].kind and parentRefs[].group for UI, API, and MCP HTTPRoutes.
  • Document the new optional kind/group fields in values.yaml under each HTTPRoute’s parentRefs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
charts/opencost/values.yaml Documents optional kind and group fields for httpRoute.parentRefs in UI/API/MCP values.
charts/opencost/templates/httproute.yaml Renders optional kind/group fields into HTTPRoute.spec.parentRefs for UI/API/MCP routes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread charts/opencost/templates/httproute.yaml Outdated
Comment thread charts/opencost/templates/httproute.yaml Outdated
Comment on lines +68 to +72
{{- if .kind }}
kind: {{ .kind }}
{{- end }}
{{- if .group }}
group: {{ .group }}
Comment thread charts/opencost/templates/httproute.yaml Outdated
@ameijer

ameijer commented May 14, 2026

Copy link
Copy Markdown
Member

@pierre-jezegou looks like some decent copilot findings, could you remediate?

@ameijer

ameijer commented May 14, 2026

Copy link
Copy Markdown
Member

and please bump the patch version on the chart

Copilot AI review requested due to automatic review settings May 15, 2026 17:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (4)

charts/opencost/templates/httproute.yaml:73

  • The {{ if .kind }} / {{ end }} and {{ if .group }} / {{ end }} blocks don’t use whitespace-trimming ({{- ... }}), which will emit whitespace-only lines in the rendered manifest. With the repo’s yamllint config enabling trailing-spaces, these space-only lines can cause ct lint to fail. Use trimmed control tags ({{- if ... }} / {{- end }}) consistent with the existing namespace/sectionName blocks so no trailing-space lines are rendered.
      {{ if .kind }}
      kind: {{ .kind | quote }}
      {{ end }}
      {{ if .group }}
      group: {{ .group | quote }}
      {{ end }}

charts/opencost/templates/httproute.yaml:123

  • The {{ if .kind }} / {{ end }} and {{ if .group }} / {{ end }} blocks don’t use whitespace-trimming ({{- ... }}), which will emit whitespace-only lines in the rendered manifest. With the repo’s yamllint config enabling trailing-spaces, these space-only lines can cause ct lint to fail. Use trimmed control tags ({{- if ... }} / {{- end }}) consistent with the existing namespace/sectionName blocks so no trailing-space lines are rendered.
      {{ if .kind }}
      kind: {{ .kind | quote }}
      {{ end }}
      {{ if .group }}
      group: {{ .group | quote }}
      {{ end }}

charts/opencost/values.yaml:456

  • These commented examples show kind/group as empty strings, but the PR description says the defaults are kind: Gateway (and default group implied by Gateway API). Using "" here is misleading for users copying the example; consider updating the commented example to show the actual defaults (or explicitly document that omitting the fields uses the Gateway API defaults).
          # kind: ""
          # group: ""

charts/opencost/values.yaml:759

  • These commented examples show kind/group as empty strings, but the PR description says the defaults are kind: Gateway (and default group implied by Gateway API). Using "" here is misleading for users copying the example; consider updating the commented example to show the actual defaults (or explicitly document that omitting the fields uses the Gateway API defaults).
          # kind: ""
          # group: ""

Comment on lines +18 to +23
{{ if .kind }}
kind: {{ .kind | quote }}
{{ end }}
{{ if .group }}
group: {{ .group | quote }}
{{ end }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@pierre-jezegou Agree with this, we should whitespace trim similar to how the rest of the template does.

Comment on lines +259 to +260
# kind: ""
# group: ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That default is not determined by this Helm chart. Closing comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Although we shouldn't set the default ourselves in the values.yaml. A comment here may help users? @pierre-jezegou?

parentRefs:
  - name: ""
    # kind: "Gateway"  # Default when omitted
    # group: "gateway.networking.k8s.io"  # Default when omitted

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