-
Notifications
You must be signed in to change notification settings - Fork 188
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 windows MountSensitive error #148
Fix windows MountSensitive error #148
Conversation
Welcome @mboersma! |
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
/approve
Thanks, we need to do hotfix in v1.18.0 too.
@gnufied coud you approve this? Thanks. |
mount/mount_windows.go
Outdated
@@ -99,13 +99,13 @@ func (mounter *Mounter) MountSensitive(source string, target string, fstype stri | |||
getSMBMountMutex.LockKey(source) | |||
defer getSMBMountMutex.UnlockKey(source) | |||
|
|||
if output, err := newSMBMapping(options[0], options[1], source); err != nil { | |||
if output, err := newSMBMapping(sensitiveOptions[0], sensitiveOptions[1], source); err != nil { |
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.
Nothing in the documentation indicates the order or distribution between options/sensitiveOptions is important... assuming a particular option will be in one or the other is fairly fragile. This was raised in #138 (comment)
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.
given the order and distribution of options is important here, I would expect something more like this:
allOptions := []string{}
allOptions = append(allOptions, options...)
allOptions = append(allOptions, sensitiveOptions...)
if len(allOptions) < 2 {
...
}
...
if output, err := newSMBMapping(allOptions[0], allOptions[1], source); err != nil {
...
}
and to document that sensitiveOptions
are always placed after options
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.
(and don't log the content of allOptions anywhere, since it can contain sensitive options)
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.
Would it be better to have a map and search for specific option keys rather than assuming the options are passed in a specific order?
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.
iiuc, these options don't have identifying keys
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.
they appear to be passed in the form "user=abc", "password=abc", so we could at least try to parse and search for the correct option?
was there a presubmit job that could have been run against kubernetes/kubernetes#88684 to catch this before merge? |
/kind bug |
Thanks for the comments on this hasty PR. I'll make changes and re-test locally. We think reverting just the azure_file.go changes in kubernetes/kubernetes#88684 would be a safer approach, and buy more time to fix this cleanly and to add unit tests. |
/lgtm |
go ahead and squash to a single commit |
cad438f
to
9162b39
Compare
/lgtm |
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
@kkmsft: GitHub didn't allow me to request PR reviews from the following users: other, in, list, -, the. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. |
/assign |
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.
Thanks for fixing this.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, kkmsft, liggitt, mboersma, saad-ali 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 |
After kubernetes/kubernetes#88684 was included in 1.18.0-rc.1, Windows volume mounts began failing in our AKS Engine e2e tests. It appears that the code path for Windows
MountSensitive
should have been looking at thesensitiveOptions
instead ofoptions
. We seeoptions
empty in every call.We've tested this interactively and found it to resolve Windows mounting problems.
cc: @kkmsft @marosset