Skip to content

feat(ingress): add support for custom labels - #781

Draft
rm3l wants to merge 5 commits into
redhat-developer:mainfrom
rm3l:feat/ingress-labels
Draft

rm3l wants to merge 5 commits into
redhat-developer:mainfrom
rm3l:feat/ingress-labels

Conversation

@rm3l

@rm3l rm3l commented Nov 17, 2026

Copy link
Copy Markdown
Member

Description of the change

Allow setting additional labels on the Ingress resource via ingress.labels,
matching the existing pattern already used by httpRoute.labels.

Previously, Ingress-specific labels could only be added via commonLabels,
which applies them to all chart resources. This adds a dedicated ingress.labels
field for labels that should only appear on the Ingress.

See also:

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

  • N/A

How to test changes / Special notes to the reviewer

helm template my-release charts/rhdh \
  --set ingress.enabled=true \
  --set ingress.labels.my-label=my-value \
  --show-only templates/ingress.yaml

Verify my-label: my-value appears in the Ingress metadata labels.

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. — N/A

Allow setting additional labels on the Ingress resource via
`ingress.labels`, matching the existing pattern used by HTTPRoute.

Signed-off-by: Armel Soro <asoro@redhat.com>
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.93%. Comparing base (6101243) to head (95585b9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #781   +/-   ##
=======================================
  Coverage   75.93%   75.93%           
=======================================
  Files          22       22           
  Lines        1467     1467           
  Branches      117      117           
=======================================
  Hits         1114     1114           
  Misses        353      353           
Flag Coverage Δ
rhdh 66.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rm3l

rm3l commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

/agentic_review

@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2026

Copy link
Copy Markdown

@rhdh-qodo-merge

Copy link
Copy Markdown

Code Review by Qodo


View low (1)
Informational
1. Ingress label overrides can collide with chart labels 🐞 Bug
Description
The new with .Values.ingress.labels block in the Ingress template renders user labels right after
rhdh.labels, with no check for keys that already exist there. A user who sets a key such as
app.kubernetes.io/instance or a key also present in commonLabels produces a duplicate key in the
metadata.labels mapping, and the Ingress render may fail or pick an unintended value depending on
the YAML parser. The same unguarded pattern exists in httproute.yaml, so this PR copies it into a
second resource.
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 Ingress template appends `.Values.ingress.labels` after `rhdh.labels`, so a user label whose key matches a chart or commonLabels key yields a duplicate key in metadata.labels.

## Fix Focus Areas
- charts/rhdh/templates/ingress.yaml[8-10]
- charts/rhdh/values.yaml[422-423]

## Recommended Fix
Either (a) document in values.yaml and the README that ingress.labels must not reuse keys from rhdh.labels or commonLabels, or (b) render the merged map with `merge` / `mergeOverwrite` via `dict` and `toYaml` so each key appears once. Verify with `helm template --set ingress.enabled=true --set ingress.labels.'app\.kubernetes\.io/instance'=x`.

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

Dismiss ↗ | View ↗


This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant