Skip to content

Commit

Permalink
Merge pull request #631 from kubernetes-sigs/smb-version-negotiate
Browse files Browse the repository at this point in the history
feat: negotiate smb version
  • Loading branch information
andyzhangx authored Apr 29, 2021
2 parents ed10001 + e3fd82d commit 6d44804
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions pkg/azurefile/azurefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ const (
subnetTemplate = "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s/subnets/%s"
fileMode = "file_mode"
dirMode = "dir_mode"
vers = "vers"
actimeo = "actimeo"
mfsymlinks = "mfsymlinks"
defaultFileMode = "0777"
defaultDirMode = "0777"
defaultVers = "3.0"
defaultActimeo = "30"

// See https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata#share-names
Expand Down Expand Up @@ -302,7 +300,6 @@ func appendDefaultMountOptions(mountOptions []string) []string {
var defaultMountOptions = map[string]string{
fileMode: defaultFileMode,
dirMode: defaultDirMode,
vers: defaultVers,
actimeo: defaultActimeo,
mfsymlinks: "",
}
Expand Down
8 changes: 1 addition & 7 deletions pkg/azurefile/azurefile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func TestAppendDefaultMountOptions(t *testing.T) {
options: []string{"dir_mode=0777"},
expected: []string{"dir_mode=0777",
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", vers, defaultVers),
fmt.Sprintf("%s=%s", actimeo, defaultActimeo),
mfsymlinks,
},
Expand All @@ -79,7 +78,6 @@ func TestAppendDefaultMountOptions(t *testing.T) {
options: []string{"file_mode=0777"},
expected: []string{"file_mode=0777",
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
fmt.Sprintf("%s=%s", vers, defaultVers),
fmt.Sprintf("%s=%s", actimeo, defaultActimeo),
mfsymlinks,
},
Expand All @@ -97,7 +95,6 @@ func TestAppendDefaultMountOptions(t *testing.T) {
options: []string{"file_mode=0777", "dir_mode=0777"},
expected: []string{
"file_mode=0777", "dir_mode=0777",
fmt.Sprintf("%s=%s", vers, defaultVers),
fmt.Sprintf("%s=%s", actimeo, defaultActimeo),
mfsymlinks,
},
Expand All @@ -108,7 +105,6 @@ func TestAppendDefaultMountOptions(t *testing.T) {
"actimeo=3",
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
fmt.Sprintf("%s=%s", vers, defaultVers),
mfsymlinks,
},
},
Expand All @@ -118,15 +114,14 @@ func TestAppendDefaultMountOptions(t *testing.T) {
mfsymlinks,
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
fmt.Sprintf("%s=%s", vers, defaultVers),
fmt.Sprintf("%s=%s", actimeo, defaultActimeo),
},
},
{
options: []string{"vers=3.1.1"},
expected: []string{"dir_mode=0777",
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", vers, "3.1.1"),
fmt.Sprintf("%s=%s", "vers", "3.1.1"),
fmt.Sprintf("%s=%s", actimeo, defaultActimeo),
mfsymlinks,
},
Expand All @@ -136,7 +131,6 @@ func TestAppendDefaultMountOptions(t *testing.T) {
expected: []string{"", fmt.Sprintf("%s=%s",
fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
fmt.Sprintf("%s=%s", vers, defaultVers),
fmt.Sprintf("%s=%s", actimeo, defaultActimeo),
mfsymlinks,
},
Expand Down

0 comments on commit 6d44804

Please # to comment.