From d37a1749ed53742361fd83b067022e64b53b6633 Mon Sep 17 00:00:00 2001 From: Matt Boersma Date: Thu, 19 Mar 2020 19:04:56 -0600 Subject: [PATCH] Fix windows MountSensitive error --- mount_windows.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mount_windows.go b/mount_windows.go index d9ae1116d68..a99fdb9ce5b 100644 --- a/mount_windows.go +++ b/mount_windows.go @@ -79,14 +79,15 @@ func (mounter *Mounter) MountSensitive(source string, target string, fstype stri sanitizedOptionsForLogging, source, target, fstype) bindSource := source - // tell it's going to mount azure disk or azure file according to options if bind, _, _, _ := MakeBindOptsSensitive(options, sensitiveOptions); bind { - // mount azure disk bindSource = NormalizeWindowsPath(source) } else { - if len(options) < 2 { + allOptions := []string{} + allOptions = append(allOptions, options...) + allOptions = append(allOptions, sensitiveOptions...) + if len(allOptions) < 2 { klog.Warningf("mount options(%q) command number(%d) less than 2, source:%q, target:%q, skip mounting", - sanitizedOptionsForLogging, len(options), source, target) + sanitizedOptionsForLogging, len(allOptions), source, target) return nil } @@ -99,13 +100,13 @@ func (mounter *Mounter) MountSensitive(source string, target string, fstype stri getSMBMountMutex.LockKey(source) defer getSMBMountMutex.UnlockKey(source) - if output, err := newSMBMapping(options[0], options[1], source); err != nil { + if output, err := newSMBMapping(allOptions[0], allOptions[1], source); err != nil { if isSMBMappingExist(source) { klog.V(2).Infof("SMB Mapping(%s) already exists, now begin to remove and remount", source) if output, err := removeSMBMapping(source); err != nil { return fmt.Errorf("Remove-SmbGlobalMapping failed: %v, output: %q", err, output) } - if output, err := newSMBMapping(options[0], options[1], source); err != nil { + if output, err := newSMBMapping(allOptions[0], allOptions[1], source); err != nil { return fmt.Errorf("New-SmbGlobalMapping remount failed: %v, output: %q", err, output) } } else {