From 2a03546bf063adbef0e0eea09cd5a05de8298f26 Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Fri, 13 Aug 2021 21:32:04 +0000 Subject: [PATCH] Pass additional flags to subpath mount to avoid flakes in certain conditions --- pkg/volume/util/subpath/subpath_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/volume/util/subpath/subpath_linux.go b/pkg/volume/util/subpath/subpath_linux.go index b2f50c20409..c9e054be41f 100644 --- a/pkg/volume/util/subpath/subpath_linux.go +++ b/pkg/volume/util/subpath/subpath_linux.go @@ -209,8 +209,9 @@ func doBindSubPath(mounter MountInterface, subpath Subpath) (hostPath string, er // Do the bind mount options := []string{"bind"} + mountFlags := []string{"--no-canonicalize"} klog.V(5).Infof("bind mounting %q at %q", mountSource, bindPathTarget) - if err = mounter.Mount(mountSource, bindPathTarget, "" /*fstype*/, options); err != nil { + if err = mounter.MountSensitiveWithFlags(mountSource, bindPathTarget, "" /*fstype*/, options, nil /* sensitiveOptions */, mountFlags); err != nil { return "", fmt.Errorf("error mounting %s: %s", subpath.Path, err) } success = true