Skip to content

[release-1.10] fix(orchestrator): lowercase and truncate DB creation Job name for compliance [RHDHBUGS-3450]#465

Open
rm3l wants to merge 1 commit into
redhat-developer:release-1.10from
rm3l:RHDHBUGS-3450--helm-orchestrator-db-creation-job-name-violates-rfc-1123-due-to-uppercase-characters-in-downstream-chart-version-only-pre-release-versions
Open

[release-1.10] fix(orchestrator): lowercase and truncate DB creation Job name for compliance [RHDHBUGS-3450]#465
rm3l wants to merge 1 commit into
redhat-developer:release-1.10from
rm3l:RHDHBUGS-3450--helm-orchestrator-db-creation-job-name-violates-rfc-1123-due-to-uppercase-characters-in-downstream-chart-version-only-pre-release-versions

Conversation

@rm3l

@rm3l rm3l commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description of the change

The versioned Job name introduced in e767157 (PR #427) embedded .Chart.Version into the orchestrator DB creation Job name without sanitizing it. Chart versions containing uppercase characters (e.g., 1.10-147-CI) produce a Job name like redhat-developer-hub-create-sf-db-1-10-147-CI, which violates Kubernetes RFC 1123 subdomain naming rules.

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

How to test changes / Special notes to the reviewer

A CI chart version should work properly once this is merged. Also, installing a very long release name should truncate to 63 chars with version suffix preserved.

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.

…C 1123 compliance

The versioned Job name introduced in e767157 did not sanitize the chart
version, so versions containing uppercase characters (e.g. 1.10-147-CI)
produced an invalid Kubernetes resource name. Add a helper that lowercases
the full name and truncates the prefix to keep the total within 63
characters while preserving the version suffix.

Ref: RHDHBUGS-3450
Assisted-by: Claude
@rm3l rm3l requested a review from a team as a code owner July 8, 2026 13:52
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@rm3l

rm3l commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

/hold

This is for 1.10.3 as it only affects pre-release/CI builds of the downstream chart. On hold until 1.10.2 is out.

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Jul 8, 2026

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again

Grey Divider

Qodo Logo

@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Fix orchestrator DB creation Job name for RFC 1123 compliance

🐞 Bug fix ⚙️ Configuration changes 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Add a Helm helper to generate RFC 1123-compliant orchestrator DB Job names.
• Replace inline Job naming with the shared helper in the sonataflows Job template.
• Bump chart version to 5.12.7 and refresh README install/version references.
Diagram

graph TD
  A["Helm release name"] --> B["sonataflows.yaml"] --> C["dbJobName helper"] --> D["_helpers.tpl"] --> E["Job metadata.name"] --> F{{"Kubernetes (RFC 1123)"}}
  H["README.md"] --> G["Chart.yaml (5.12.7)"] --> B
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Inline sanitization in sonataflows.yaml
  • ➕ Minimal indirection; logic stays next to the Job definition
  • ➖ Repeats logic if other templates need the same naming behavior
  • ➖ Harder to test/maintain consistently across templates
2. Sanitize only the version suffix (lower/regex) and keep full prefix
  • ➕ Avoids truncation complexity for the release-name prefix
  • ➖ Still risks exceeding the 63-character constraint for long release names
  • ➖ Does not address length issues unless additional guards are added
3. Use a hash-based suffix when exceeding limits
  • ➕ Guaranteed uniqueness and length compliance regardless of inputs
  • ➖ Loses human-readable version in the resource name (unless dual labels/annotations added)
  • ➖ Slightly more complex and less transparent for operators

Recommendation: Current approach (helper + lowercase + prefix truncation while preserving the full version suffix) is the best tradeoff here: it centralizes naming logic, fixes RFC 1123 violations from uppercase chart versions, and proactively handles the 63-character constraint without sacrificing the version signal in the name. The main alternatives either leave length risks unaddressed or reduce readability by introducing hashes.

Files changed (4) +14 / -4

Bug fix (2) +11 / -1
_helpers.tplAdd helper to generate RFC 1123-compliant DB Job name +10/-0

Add helper to generate RFC 1123-compliant DB Job name

• Introduces rhdh.orchestrator.dbJobName to build the Job name by preserving the full version suffix, truncating the release-name-derived prefix to fit within 63 characters, and lowercasing the final result.

charts/backstage/templates/_helpers.tpl

sonataflows.yamlUse shared helper for orchestrator DB creation Job name +1/-1

Use shared helper for orchestrator DB creation Job name

• Replaces the inline Job metadata.name expression with an include of rhdh.orchestrator.dbJobName to ensure consistent sanitization and length handling.

charts/backstage/templates/sonataflows.yaml

Documentation (1) +2 / -2
README.mdUpdate README version badge and install example +2/-2

Update README version badge and install example

• Refreshes the displayed chart version badge and the example helm install command to reference 5.12.7.

charts/backstage/README.md

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

Bump chart version to 5.12.7

• Updates the chart version from 5.12.6 to 5.12.7 to publish the naming fix.

charts/backstage/Chart.yaml

@rm3l rm3l changed the title fix(orchestrator): lowercase and truncate DB creation Job name for RFC 1123 compliance [release-1.10] fix(orchestrator): lowercase and truncate DB creation Job name for RFC 1123 compliance [RHDHBUGS-3450] Jul 8, 2026
@rm3l rm3l changed the title [release-1.10] fix(orchestrator): lowercase and truncate DB creation Job name for RFC 1123 compliance [RHDHBUGS-3450] [release-1.10] fix(orchestrator): lowercase and truncate DB creation Job name for compliance [RHDHBUGS-3450] Jul 8, 2026
@rhdh-qodo-merge rhdh-qodo-merge Bot added documentation Improvements or additions to documentation Bug fix labels Jul 8, 2026
@rm3l

rm3l commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/hold cancel

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

Labels

Bug fix documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant