Merge pull request #104253 from mauriciopoppe/subpath-additional-mount-flag

Pass additional flags to subpath mount to avoid flakes in certain conditions
This commit is contained in:
Kubernetes Prow Robot
2021-08-11 02:08:58 -07:00
committed by GitHub
7 changed files with 84 additions and 19 deletions

View File

@@ -209,8 +209,9 @@ func doBindSubPath(mounter mount.Interface, subpath Subpath) (hostPath string, e
// 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.MountSensitiveWithoutSystemd(mountSource, bindPathTarget, "" /*fstype*/, options, nil); err != nil {
if err = mounter.MountSensitiveWithoutSystemdWithMountFlags(mountSource, bindPathTarget, "" /*fstype*/, options, nil /* sensitiveOptions */, mountFlags); err != nil {
return "", fmt.Errorf("error mounting %s: %s", subpath.Path, err)
}
success = true