Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kube volumes can not contain _ #24868

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Kube volumes can not contain _ #24868

wants to merge 1 commit into from

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Dec 18, 2024

Need to substiture all _ to - for k8s support.

Does this PR introduce a user-facing change?

None

Need to substiture all _ to - for k8s support.

Signed-off-by: Daniel J Walsh <[email protected]>
@openshift-ci openshift-ci bot added release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 18, 2024
@rhatdan rhatdan changed the title Kube volumes can not container _ Kube volumes can not contain _ Dec 18, 2024
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

non blocking nit.

LGTM

Comment on lines +1265 to +1273
func fixKubeVolumeName(source string) string {
// Trim trailing slashes,
// Replace slashes with dashes.
// Replace underscores with dashes.
// Force all letters to lower case
// Thus, /mnt/data/ will become mnt-data
return strings.ToLower(strings.ReplaceAll(strings.ReplaceAll(strings.Trim(source, "/"), "/", "-"), "_", "-"))
}

Copy link
Member

Choose a reason for hiding this comment

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

this is the perfect candidate for a unit test.

Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, rhatdan

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

The pull request process is described here

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants