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

fix: handle trailing slash in mount paths for hostpath mapper #2169

Merged

Conversation

neogopher
Copy link
Contributor

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

Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for vcluster-docs canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 45dcf36
🔍 Latest deploy log https://app.netlify.com/sites/vcluster-docs/deploys/66f1743e0e92d700081e2081

@neogopher neogopher added the backport-to-v0.20 backport this PR to v0.20 branch label Sep 23, 2024
@@ -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, "/")
Copy link
Contributor

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?

Copy link
Member

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

@FabianKramm FabianKramm merged commit dcbbeef into loft-sh:main Sep 24, 2024
62 checks passed
@loft-bot
Copy link

💚 All backports created successfully

Status Branch Result
v0.20

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v0.20 backport this PR to v0.20 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants