diff --git a/pkg/volume/azure_file/azure_file.go b/pkg/volume/azure_file/azure_file.go index 07bcb3a9bb8..3d7aed3428d 100644 --- a/pkg/volume/azure_file/azure_file.go +++ b/pkg/volume/azure_file/azure_file.go @@ -272,18 +272,20 @@ func (b *azureFileMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) e } var mountOptions []string + var sensitiveMountOptions []string source := "" osSeparator := string(os.PathSeparator) source = fmt.Sprintf("%s%s%s.file.%s%s%s", osSeparator, osSeparator, accountName, getStorageEndpointSuffix(b.plugin.host.GetCloudProvider()), osSeparator, b.shareName) if runtime.GOOS == "windows" { - mountOptions = []string{fmt.Sprintf("AZURE\\%s", accountName), accountKey} + sensitiveMountOptions = []string{fmt.Sprintf("AZURE\\%s", accountName), accountKey} } else { if err := os.MkdirAll(dir, 0700); err != nil { return err } // parameters suggested by https://azure.microsoft.com/en-us/documentation/articles/storage-how-to-use-files-linux/ - options := []string{fmt.Sprintf("username=%s,password=%s", accountName, accountKey)} + options := []string{} + sensitiveMountOptions = []string{fmt.Sprintf("username=%s,password=%s", accountName, accountKey)} if b.readOnly { options = append(options, "ro") } @@ -293,7 +295,7 @@ func (b *azureFileMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) e mountComplete := false err = wait.Poll(5*time.Second, 10*time.Minute, func() (bool, error) { - err := b.mounter.Mount(source, dir, "cifs", mountOptions) + err := b.mounter.MountSensitive(source, dir, "cifs", mountOptions, sensitiveMountOptions) mountComplete = true return true, err })