Skip to content

chore: Updating hardcoded backend service port for Ingress & HTTPRoute templates - #620

Merged
rm3l merged 5 commits into
redhat-developer:mainfrom
OpinionatedHeron:servicePort
Oct 12, 2026
Merged

rm3l merged 5 commits into
redhat-developer:mainfrom
OpinionatedHeron:servicePort

Conversation

@OpinionatedHeron

Copy link
Copy Markdown
Member

Description of the change

The rhdh Helm chart's Ingress and HTTPRoute templates hardcode the backend service port with no way for users to override it per path or per rule. Updated templates to allow per-path/rule port overrides while keeping full backward compatibility.

Which issue(s) does this PR fix or relate to

Checklist

  • For each Chart updated, version bumped in the corresponding Chart.yaml according to Semantic Versioning.
  • For each Chart updated, variables are documented in the values.yaml and added to the corresponding README.md. The pre-commit utility can be used to generate the necessary content. Run pre-commit run --all-files to run the hooks and then push any resulting changes. The pre-commit Workflow will enforce this and warn you if needed.
  • JSON Schema template updated and re-generated the raw schema via the pre-commit hook.
  • Tests pass using the Chart Testing tool and the ct lint command.
  • If you updated the orchestrator-infra chart, make sure the versions of the Knative CRDs are aligned with the versions of the CRDs installed by the OpenShift Serverless operators declared in the values.yaml file. See Installing Knative Eventing and Knative Serving CRDs for more details.

Signed-off-by: Leanne Ahern <lahern@redhat.com>
Signed-off-by: Leanne Ahern <lahern@redhat.com>
Signed-off-by: Leanne Ahern <lahern@redhat.com>
@OpinionatedHeron
OpinionatedHeron requested a review from rm3l October 12, 2026 14:31
@OpinionatedHeron
OpinionatedHeron requested a review from a team as a code owner October 12, 2026 14:31
@openshift-ci
openshift-ci Bot requested a review from subhashkhileri October 12, 2026 14:31
@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Allow backend port overrides per Ingress path and HTTPRoute rule

✨ Enhancement 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Allow each Ingress path and HTTPRoute rule to select its backend service port.
• Preserve the existing service port when no override is supplied.
• Document the overrides and bump the RHDH chart version to 3.5.5.
Diagram

graph TD
  V["Helm values"] --> IP["Ingress paths"] --> I["Ingress backend"] --> S["Service port"]
  V --> HR["HTTPRoute rules"] --> H["HTTPRoute backend"] --> S
Loading
High-Level Assessment

Keep the per-path and per-rule overrides in their respective templates. This directly matches the existing values structure and preserves defaults without introducing a shared abstraction for two simple expressions.

Files changed (5) +12 / -5

Enhancement (2) +2 / -2
httproute.yamlSelect HTTPRoute backend port per rule +1/-1

Select HTTPRoute backend port per rule

• Uses a rule's port when provided and otherwise retains the service port as the backend reference port.

charts/rhdh/templates/httproute.yaml

ingress.yamlSelect Ingress backend port per path +1/-1

Select Ingress backend port per path

• Uses a path's port when provided and otherwise retains the service port as the backend port.

charts/rhdh/templates/ingress.yaml

Documentation (2) +9 / -2
README.mdDocument backend port overrides and chart version +4/-2

Document backend port overrides and chart version

• Updates the version badge and install command to 3.5.5. Adds values-table descriptions for per-path Ingress and per-rule HTTPRoute port overrides.

charts/rhdh/README.md

values.yamlExplain optional port values in chart defaults +5/-0

Explain optional port values in chart defaults

• Documents the optional path and rule port settings, their fallback to service.port, and an Ingress sidecar-port example.

charts/rhdh/values.yaml

Other (1) +1 / -1
Chart.yamlBump RHDH chart version to 3.5.5 +1/-1

Bump RHDH chart version to 3.5.5

• Increments the chart patch version for the backend port override enhancement.

charts/rhdh/Chart.yaml

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Malformed override ports reach Kubernetes ✓ Resolved
Description
The Ingress and HTTPRoute templates emit user-provided port values without schema validation or
type conversion. When either override is supplied as an invalid value such as a non-numeric string,
Helm accepts it and the generated resource is rejected by Kubernetes during deployment.
Code

charts/rhdh/templates/httproute.yaml[50]

+          port: {{ .port | default $svcPort }}
Relevance

●●● Strong

Recent reviews accepted tightening Helm schemas to prevent invalid values reaching rendered
Kubernetes resources.

PR-#500
PR-#407

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both templates now directly emit the nested override values, but the corresponding schema sections
only declare hosts and rules as arrays without item definitions. Consequently Helm has no type
constraint for either new port field, while the generated resources require numeric backend ports.

charts/rhdh/templates/ingress.yaml[43-45]
charts/rhdh/templates/httproute.yaml[47-50]
charts/rhdh/values.schema.tmpl.json[259-263]
charts/rhdh/values.schema.tmpl.json[286-290]
charts/rhdh/values.schema.json[692-697]
charts/rhdh/values.schema.json[755-775]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new Ingress path and HTTPRoute rule `port` overrides are documented and emitted by the templates, but neither `values.schema.tmpl.json` nor the generated `values.schema.json` describes these nested fields. Invalid values can therefore pass Helm validation and produce Kubernetes resources with invalid backend port types.

## Fix Focus Areas
- charts/rhdh/values.schema.tmpl.json[259-263]
- charts/rhdh/values.schema.tmpl.json[286-290]
- charts/rhdh/values.schema.json[755-775]
- charts/rhdh/values.schema.json[692-697]

## Recommended Fix
Define the `hosts[].paths[].port` and `rules[].port` schema fields as integer values with the appropriate Kubernetes port bounds, while preserving the existing unconstrained fields needed by the templates. Regenerate `values.schema.json` from the schema template and add validation coverage for valid and invalid override values.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
⚠️ Tickets: not configured — ticket URL found in PR but could not be fetched — check ticket provider credentials
✅ Cross-repo context — repo relationships
Review mode: Auto: 🚀 Fast: Localized schema additions with low, contained behavioral risk.

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 6d38c53

Results up to commit a39a19d 🚀 Fast


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Malformed override ports reach Kubernetes ✓ Resolved
Description
The Ingress and HTTPRoute templates emit user-provided port values without schema validation or
type conversion. When either override is supplied as an invalid value such as a non-numeric string,
Helm accepts it and the generated resource is rejected by Kubernetes during deployment.
Code

charts/rhdh/templates/httproute.yaml[50]

+          port: {{ .port | default $svcPort }}
Relevance

●●● Strong

Recent reviews accepted tightening Helm schemas to prevent invalid values reaching rendered
Kubernetes resources.

PR-#500
PR-#407

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both templates now directly emit the nested override values, but the corresponding schema sections
only declare hosts and rules as arrays without item definitions. Consequently Helm has no type
constraint for either new port field, while the generated resources require numeric backend ports.

charts/rhdh/templates/ingress.yaml[43-45]
charts/rhdh/templates/httproute.yaml[47-50]
charts/rhdh/values.schema.tmpl.json[259-263]
charts/rhdh/values.schema.tmpl.json[286-290]
charts/rhdh/values.schema.json[692-697]
charts/rhdh/values.schema.json[755-775]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new Ingress path and HTTPRoute rule `port` overrides are documented and emitted by the templates, but neither `values.schema.tmpl.json` nor the generated `values.schema.json` describes these nested fields. Invalid values can therefore pass Helm validation and produce Kubernetes resources with invalid backend port types.

## Fix Focus Areas
- charts/rhdh/values.schema.tmpl.json[259-263]
- charts/rhdh/values.schema.tmpl.json[286-290]
- charts/rhdh/values.schema.json[755-775]
- charts/rhdh/values.schema.json[692-697]

## Recommended Fix
Define the `hosts[].paths[].port` and `rules[].port` schema fields as integer values with the appropriate Kubernetes port bounds, while preserving the existing unconstrained fields needed by the templates. Regenerate `values.schema.json` from the schema template and add validation coverage for valid and invalid override values.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@rhdh-qodo-merge

Copy link
Copy Markdown

Important

The /generate_labels command by Qodo was deprecated on the 1st of October 2026 and is no longer available. We recommend switching to the latest Qodo review capabilities. Learn more

Signed-off-by: Leanne Ahern <lahern@redhat.com>
@sonarqubecloud

Copy link
Copy Markdown

@OpinionatedHeron

Copy link
Copy Markdown
Member Author

/agentic_review

@rhdh-qodo-merge

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6d38c53

@rm3l rm3l left a 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.

Thanks @OpinionatedHeron !!

@rm3l

rm3l commented Oct 12, 2026

Copy link
Copy Markdown
Member

/cherrypick release-2.1

@openshift-cherrypick-robot

Copy link
Copy Markdown

@rm3l: once the present PR merges, I will cherry-pick it on top of release-2.1 in a new PR and assign it to you.

Details

In response to this:

/cherrypick release-2.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@rm3l
rm3l merged commit 3ca205e into redhat-developer:main Oct 12, 2026
7 of 8 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown

@rm3l: #620 failed to apply on top of branch "release-2.1":

Applying: Updating templates
Applying: Updating ReadMe and adding notes to values file
Using index info to reconstruct a base tree...
M	charts/rhdh/README.md
M	charts/rhdh/values.yaml
Falling back to patching base and 3-way merge...
Auto-merging charts/rhdh/README.md
CONFLICT (content): Merge conflict in charts/rhdh/README.md
Auto-merging charts/rhdh/values.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Updating ReadMe and adding notes to values file

Details

In response to this:

/cherrypick release-2.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

rm3l pushed a commit that referenced this pull request Oct 12, 2026
* chore: Updating hardcoded backend service port for Ingress & HTTPRoute templates (#620)
cherry-picking to release 2.1

Signed-off-by: Leanne Ahern <lahern@redhat.com>
(cherry picked from commit 3ca205e)

* fix: resolve cherry-pick conflicts for release-2.1

Keep release-2.1 chart versioning (3.4.7 / appVersion 2.1.0) and
next-2.1 image tag while retaining the port-override README docs.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: Leanne Ahern <lahern@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants