Skip to content

Commit

Permalink
Merge pull request #2171 from loft-sh/backport/v0.20/pr-2169
Browse files Browse the repository at this point in the history
[v0.20] Merge pull request #2169 from neogopher/hpm-handle-trailingslash-mountpaths
  • Loading branch information
FabianKramm authored Sep 24, 2024
2 parents 1041fb6 + 48c6633 commit 78e44e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controllers/resources/pods/translate/hostpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "/")

if volumeMount.MountPath == PodLoggingHostPath ||
volumeMount.MountPath == KubeletPodPath ||
volumeMount.MountPath == LogHostPath {
Expand Down

0 comments on commit 78e44e4

Please sign in to comment.