Skip to content

Commit

Permalink
Merge pull request #1252 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1244-to-release-1.26

[release-1.26] fix: default actimeo option should respect acregmax and acdirmax
  • Loading branch information
andyzhangx authored May 13, 2023
2 parents bd32f9f + 88f343c commit e88c0dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/azurefile/azurefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ func appendDefaultMountOptions(mountOptions []string) []string {
included[k] = true
}
}
// actimeo would set both acregmax and acdirmax, so we only need to check one of them
if strings.Contains(mountOption, "acregmax") || strings.Contains(mountOption, "acdirmax") {
included[actimeo] = true
}
}

allMountOptions := mountOptions
Expand All @@ -449,11 +453,6 @@ func appendDefaultMountOptions(mountOptions []string) []string {
}
}

/* todo: looks like fsGroup is not included in CSI
if !gidFlag && fsGroup != nil {
allMountOptions = append(allMountOptions, fmt.Sprintf("%s=%d", gid, *fsGroup))
}
*/
return allMountOptions
}

Expand Down
18 changes: 18 additions & 0 deletions pkg/azurefile/azurefile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,24 @@ func TestAppendDefaultMountOptions(t *testing.T) {
mfsymlinks,
},
},
{
options: []string{"acregmax=1"},
expected: []string{
"acregmax=1",
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
mfsymlinks,
},
},
{
options: []string{"acdirmax=2"},
expected: []string{
"acdirmax=2",
fmt.Sprintf("%s=%s", fileMode, defaultFileMode),
fmt.Sprintf("%s=%s", dirMode, defaultDirMode),
mfsymlinks,
},
},
{
options: []string{mfsymlinks},
expected: []string{
Expand Down

0 comments on commit e88c0dd

Please sign in to comment.