-
Notifications
You must be signed in to change notification settings - Fork 40k
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 azure file plugin failure issue on Windows after node restart #60625
fix azure file plugin failure issue on Windows after node restart #60625
Conversation
/kind bug |
Added to v1.10 milestone since it is a critical bug fix. cc @jdumars |
@@ -241,8 +242,20 @@ func (b *azureFileMounter) SetUpAt(dir string, fsGroup *int64) error { | |||
return err | |||
} | |||
if !notMnt { | |||
return nil | |||
// testing original mount point, make sure the mount link is valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for windows only? consider applying 'if runtime.GOOS == "windows" '
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to make it generic, same logic as azure-disk mount: https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_dd/azure_mounter.go#L88-L100
pkg/volume/azure_file/azure_file.go
Outdated
return nil | ||
// testing original mount point, make sure the mount link is valid | ||
if _, err := ioutil.ReadDir(dir); err == nil { | ||
glog.V(2).Infof("azureFile - already mounted to target %s", dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
level V(2) maybe to high for the hint, probably <=4 as Line#240
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
glog.Errorf("azureFile - Unmount directory %s failed with %v", dir, err) | ||
return err | ||
} | ||
notMnt = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this notMnt val is not used later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notMnt should set as true since it's not a mounting point after unmount, same logic as azure disk
fix comments
d2a58db
to
dce507c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karataliu fixed comments
@@ -241,8 +242,20 @@ func (b *azureFileMounter) SetUpAt(dir string, fsGroup *int64) error { | |||
return err | |||
} | |||
if !notMnt { | |||
return nil | |||
// testing original mount point, make sure the mount link is valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to make it generic, same logic as azure-disk mount: https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_dd/azure_mounter.go#L88-L100
pkg/volume/azure_file/azure_file.go
Outdated
return nil | ||
// testing original mount point, make sure the mount link is valid | ||
if _, err := ioutil.ReadDir(dir); err == nil { | ||
glog.V(2).Infof("azureFile - already mounted to target %s", dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
glog.Errorf("azureFile - Unmount directory %s failed with %v", dir, err) | ||
return err | ||
} | ||
notMnt = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notMnt should set as true since it's not a mounting point after unmount, same logic as azure disk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, karataliu 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 |
Automatic merge from submit-queue (batch tested with PRs 60623, 60625, 60520). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
azure file plugin on Windows does not work after node restart, this is due to New-SmbGlobalMapping powershell cmdlet has lost account name/key after reboot, we should remove the invalid link and do the mount again after kubelet restart.
add remount logic for azure file plugin in this PR
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #60624
Special notes for your reviewer:
Release note:
/sig azure
/sig windows
/assign @karataliu
@feiskyer pls mark this PR as v1.10 milestone, thanks