-
Notifications
You must be signed in to change notification settings - Fork 423
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
fix: handle trailing slash in mount paths for hostpath mapper #2169
fix: handle trailing slash in mount paths for hostpath mapper #2169
Conversation
✅ Deploy Preview for vcluster-docs canceled.Built without sensitive environment variables
|
@@ -25,6 +25,9 @@ const ( | |||
func (t *translator) ensureMountPropagation(pPod *corev1.Pod) { | |||
for i, container := range pPod.Spec.Containers { | |||
for j, volumeMount := range container.VolumeMounts { | |||
// handle scenarios where path ends with a / | |||
volumeMount.MountPath = strings.TrimSuffix(volumeMount.MountPath, "/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add unit test case for it to the TestVolumeTranslation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this for now, we can do a separate PR with the unit test
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
[v0.20] Merge pull request #2169 from neogopher/hpm-handle-trailingslash-mountpaths
What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>
if possible)resolves ENG-4427
Please provide a short message that should be published in the vcluster release notes
Fixed an issue where bind mounts for hostpath mapping would not forward changes correctly when mountpath contained a trailing forward-slash