Skip to content
This repository was archived by the owner on Aug 4, 2026. It is now read-only.

fix: generate safe ingress hostnames for long PVC namespaces - #33

Closed
msajidmansoori12 wants to merge 3 commits into
backube:mainfrom
msajidmansoori12:fix-hostname-validation
Closed

msajidmansoori12 wants to merge 3 commits into
backube:mainfrom
msajidmansoori12:fix-hostname-validation

Conversation

@msajidmansoori12

Copy link
Copy Markdown

Describe what this PR does
This PR fixes ingress hostname generation for long PVC name/namespace combinations.
Previously, the ingress host prefix was truncated with a raw slice, which could leave the first DNS label ending in - and cause Kubernetes to reject the Ingress as invalid.

The fix replaces plain truncation with safe hash-based truncation so long generated hostnames remain RFC1123-compliant while also reducing collisions for similar long names.

Is there anything that requires special attention?
This change only affects long generated ingress hostnames. Short hostnames are unchanged.

I verified the fix locally by reproducing the original failure case with a 63-character namespace on minikube. Before this change, transfer-pvc failed during Ingress creation with spec.rules[0].host: Invalid value. After this change, the generated ingress hostname is valid and the PVC transfer completes successfully.

Related issues:

Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
@openshift-ci openshift-ci Bot added the size/XS label Aug 3, 2026
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
@openshift-ci openshift-ci Bot added size/M and removed size/XS labels Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@aufi: changing LGTM is restricted to collaborators

Details

In response to this:

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.

@JohnStrunk

Copy link
Copy Markdown
Member

/approve
/lgtm

@JohnStrunk

Copy link
Copy Markdown
Member

I re-enabled GH actions, but I think you're going to have to push another commit to actually trigger the run.

Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
@openshift-ci openshift-ci Bot removed the lgtm label Aug 4, 2026
@msajidmansoori12

Copy link
Copy Markdown
Author

Hi @JohnStrunk , i re pushed a commit but lgtm label is removed , can you please add it again. Thanks !

@JohnStrunk JohnStrunk 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.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aufi, JohnStrunk, msajidmansoori12

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@msajidmansoori12 msajidmansoori12 closed this by deleting the head repository Aug 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants