Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix smb remount issue on Windows #73661

Merged
merged 1 commit into from
Feb 15, 2019

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Feb 2, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
fix smb remount issue on Windows by:

if smb mount failed:
   if the original smb mount exists:
      remove original smb mount
      mount again

Without this PR, smb remount on same windows node would fail since original mount already exists

Which issue(s) this PR fixes:

Fixes #73087

Special notes for your reviewer:

  • move part of the code from mounter.Mount func and add following code to check whether remotepath has already been mapped
		cmd := exec.Command("powershell", "/c", `Get-SmbGlobalMapping -RemotePath $Env:smbremotepath`)
		cmd.Env = append(os.Environ(), fmt.Sprintf("smbremotepath=%s", remotepath))
		output, err = cmd.CombinedOutput()

Does this PR introduce a user-facing change?:

NONE

Release note:

fix smb remount issue on Windows

/sig windows

/assign @msau42 @jsafrane
cc @jingxu97

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/windows Categorizes an issue or PR as relevant to SIG Windows. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 2, 2019
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 2, 2019
@andyzhangx
Copy link
Member Author

andyzhangx commented Feb 2, 2019

/pull-kubernetes-cross
/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 2, 2019
@PatrickLang PatrickLang added this to Backlog in SIG-Windows Feb 5, 2019
@PatrickLang
Copy link
Contributor

/milestone v1.14

@k8s-ci-robot k8s-ci-robot added this to the v1.14 milestone Feb 5, 2019
@PatrickLang PatrickLang moved this from Backlog to In Review in SIG-Windows Feb 5, 2019
pkg/util/mount/mount_windows.go Outdated Show resolved Hide resolved
add comments for doSMBMount func

fix comments about smb mount
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 14, 2019
@andyzhangx
Copy link
Member Author

/pull-kubernetes-cross

@andyzhangx
Copy link
Member Author

@PatrickLang I have changed the PR according to your comments, test with delete pod of k8s deployment on windows shows good

@msau42
Copy link
Member

msau42 commented Feb 15, 2019

/assign @jingxu97
to help take a look

@PatrickLang
Copy link
Contributor

/LGTM
thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2019
@jsafrane
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, jsafrane

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2019
@k8s-ci-robot k8s-ci-robot merged commit 9027738 into kubernetes:master Feb 15, 2019
SIG-Windows automation moved this from In Review to Done (v.1.14) Feb 15, 2019
k8s-ci-robot added a commit that referenced this pull request Feb 20, 2019
…3661-upstream-release-1.12

Automated cherry pick of #73661
k8s-ci-robot added a commit that referenced this pull request Feb 23, 2019
…3661-upstream-release-1.11

Automated cherry pick of #73661
k8s-ci-robot added a commit that referenced this pull request Feb 23, 2019
…3661-upstream-release-1.13

Automated cherry pick of #73661
@andyzhangx
Copy link
Member Author

this issue is finally fixed in 1.11.8, 1.12.6, 1.13.4, and 1.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azure file remount on Windows in same node would fail
6 participants