Pass additional flags to subpath mount to avoid flakes in certain conditions

This commit is contained in:
Mauricio Poppe 2021-08-13 21:32:04 +00:00
parent ce5e9f6c83
commit 2a03546bf0

View file

@ -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