Skip to content

Commit

Permalink
Merge pull request #1854 from kubernetes-sigs/trim-remove-smb-mount-s…
Browse files Browse the repository at this point in the history
…uffix

fix: trim slash in RemoveSmbGlobalMapping
  • Loading branch information
andyzhangx committed Apr 19, 2024
2 parents 88a972e + f09cb7d commit 19eabf1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/os/smb/smb.go
Expand Up @@ -57,6 +57,7 @@ func NewSmbGlobalMapping(remotePath, username, password string) error {
}

func RemoveSmbGlobalMapping(remotePath string) error {
remotePath = strings.TrimSuffix(remotePath, `\`)
cmd := `Remove-SmbGlobalMapping -RemotePath $Env:smbremotepath -Force`
klog.V(2).Infof("begin to run RemoveSmbGlobalMapping with %s", remotePath)
if output, err := util.RunPowershellCmd(cmd, fmt.Sprintf("smbremotepath=%s", remotePath)); err != nil {
Expand Down

0 comments on commit 19eabf1

Please sign in to comment.