Skip to content

Commit

Permalink
Merge pull request kubernetes#99705 from andyzhangx/automated-cherry-…
Browse files Browse the repository at this point in the history
…pick-of-#99550-upstream-release-1.20

Automated cherry pick of kubernetes#99550: fix smb mount issue on Windows
  • Loading branch information
k8s-ci-robot committed May 7, 2021
2 parents fee056f + 8feee7e commit 0472369
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion staging/src/k8s.io/mount-utils/mount_windows.go
Expand Up @@ -164,7 +164,7 @@ func newSMBMapping(username, password, remotepath string) (string, error) {
// https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-5.1
cmdLine := `$PWord = ConvertTo-SecureString -String $Env:smbpassword -AsPlainText -Force` +
`;$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Env:smbuser, $PWord` +
`;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Credential $Credential`
`;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Credential $Credential -RequirePrivacy $true`
cmd := exec.Command("powershell", "/c", cmdLine)
cmd.Env = append(os.Environ(),
fmt.Sprintf("smbuser=%s", username),
Expand Down

0 comments on commit 0472369

Please sign in to comment.