Skip to content

Set the HostPathVolume name to the normalized host path instead of volume-x#2808

Open
JonasScharpf wants to merge 2 commits intojenkinsci:masterfrom
JonasScharpf:feature/set-known-name-for-hostpathvolume-instead-of-volume-x
Open

Set the HostPathVolume name to the normalized host path instead of volume-x#2808
JonasScharpf wants to merge 2 commits intojenkinsci:masterfrom
JonasScharpf:feature/set-known-name-for-hostpathvolume-instead-of-volume-x

Conversation

@JonasScharpf
Copy link
Copy Markdown

This ensures the name of a HostPathVolume is known a priori and static. Previously the name was volume-x with x as a non static number, which might change when adding or removing volumes of a pod.

The name of the HostPathVolume is the specified normalized host path and its / being replaced by -. A host path like /mnt/my/path/on-a_host will generate the HostPathVolume name as mnt-my-path-on-a_host

Testing done

The plugin has been build and deployed to my Jenkins instance. The plugin config output has been validated by printing the raw YAML to the console.

All unit tests have been successfully executed on my machine.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

…lume-x

This ensures the name of a HostPathVolume is known apriori and static.
Previously the name was "volume-x" with x as a non static number, which might change when adding or removing volumes of a pod.

The name of the HostPathVolume is the specified normalized host path and its "/" being replaced by "-".
A host path like "/mnt/my/path/on-a_host" will generate the HostPathVolume name as "mnt-my-path-on-a_host"
@JonasScharpf JonasScharpf requested a review from a team as a code owner February 4, 2026 12:03
…e if fullfilled

This commit does change the HostPathVolume name to only consist of lower case alphanumeric characters or '-'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant