Skip to content

Commit 042958f

Browse files
authored
Merge pull request #1554 from mowangdk/cleanup/disable_auto_fallabck_for_bmcpfs
Disable additional cgroup of efc container
2 parents 0a6bdf5 + 407545e commit 042958f

File tree

4 files changed

+80
-4
lines changed

4 files changed

+80
-4
lines changed

build/csi-agent/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ARG TARGETPLATFORM
1818
# The versions specified here are for RPM packages, which may not necessarily align with the image version
1919
ARG OSSFS_VERSION=v1.91.8.ack.3
2020
ARG OSSFS2_VERSION=v2.0.4.ack.1
21-
ARG ALINAS_UTILS_VERSION=1.9-0.20250805171424.2871b7.al7
21+
ARG ALINAS_UTILS_VERSION=1.9-0.20251120211108.7e6a18.al7
2222
ARG EFC_VERSION=1.9-20250822095129.f34347.release
2323
# v2.1 is exclusive to a specific storage cluster version and the first to support ARM arch.
2424
# It's temporarily unavailable for all ACK clusters,

build/mount-proxy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ENTRYPOINT ["csi-mount-proxy-server", "--driver=ossfs2"]
9696
FROM registry-cn-hangzhou.ack.aliyuncs.com/dev/alinux:3-update as alinas
9797

9898
ARG TARGETPLATFORM
99-
ARG ALINAS_UTILS_VERSION=1.9-0.20250805171424.2871b7.al7
99+
ARG ALINAS_UTILS_VERSION=1.9-0.20251120211108.7e6a18.al7
100100
ARG EFC_VERSION=1.9-20250822095129.f34347.release
101101
# v2.1 is exclusive to a specific storage cluster version and the first to support ARM arch.
102102
# It's temporarily unavailable for all ACK clusters,

pkg/mounter/proxy/server/alinas/driver.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ func addAutoFallbackNFSMountOptions(mountOptions []string) []string {
9292
}
9393
}
9494
}
95-
if isEFC && !isVSC {
96-
mountOptions = append(mountOptions, "auto_fallback_nfs")
95+
if isEFC {
96+
mountOptions = append(mountOptions, "no_add_cgroup")
97+
if !isVSC {
98+
mountOptions = append(mountOptions, "auto_fallback_nfs")
99+
}
97100
}
98101
return mountOptions
99102
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package alinas
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/assert"
7+
)
8+
9+
func TestAddAutoFallbackNFSMountOptions(t *testing.T) {
10+
tests := []struct {
11+
name string
12+
inputOptions []string
13+
expected []string
14+
}{
15+
{
16+
name: "Empty options",
17+
inputOptions: []string{},
18+
expected: []string{},
19+
},
20+
{
21+
name: "EFC without VSC should add both no_add_cgroup and auto_fallback_nfs",
22+
inputOptions: []string{"efc"},
23+
expected: []string{"efc", "no_add_cgroup", "auto_fallback_nfs"},
24+
},
25+
{
26+
name: "EFC with VSC should only add no_add_cgroup",
27+
inputOptions: []string{"efc", "net=vsc"},
28+
expected: []string{"efc", "net=vsc", "no_add_cgroup"},
29+
},
30+
{
31+
name: "EFC with non-VSC net option should add both options",
32+
inputOptions: []string{"efc", "net=other"},
33+
expected: []string{"efc", "net=other", "no_add_cgroup", "auto_fallback_nfs"},
34+
},
35+
{
36+
name: "Multiple options with EFC but no VSC",
37+
inputOptions: []string{"rw", "efc", "hard"},
38+
expected: []string{"rw", "efc", "hard", "no_add_cgroup", "auto_fallback_nfs"},
39+
},
40+
{
41+
name: "Multiple options with EFC and VSC",
42+
inputOptions: []string{"rw", "efc", "net=vsc", "hard"},
43+
expected: []string{"rw", "efc", "net=vsc", "hard", "no_add_cgroup"},
44+
},
45+
{
46+
name: "No EFC should not add any options",
47+
inputOptions: []string{"rw", "hard"},
48+
expected: []string{"rw", "hard"},
49+
},
50+
{
51+
name: "Comma-separated options with EFC but no VSC",
52+
inputOptions: []string{"rw,efc,hard"},
53+
expected: []string{"rw,efc,hard", "no_add_cgroup", "auto_fallback_nfs"},
54+
},
55+
{
56+
name: "Comma-separated options with EFC and VSC",
57+
inputOptions: []string{"rw,efc,net=vsc,hard"},
58+
expected: []string{"rw,efc,net=vsc,hard", "no_add_cgroup"},
59+
},
60+
{
61+
name: "Empty option string in slice",
62+
inputOptions: []string{"", "efc"},
63+
expected: []string{"", "efc", "no_add_cgroup", "auto_fallback_nfs"},
64+
},
65+
}
66+
67+
for _, tt := range tests {
68+
t.Run(tt.name, func(t *testing.T) {
69+
result := addAutoFallbackNFSMountOptions(tt.inputOptions)
70+
assert.Equal(t, tt.expected, result)
71+
})
72+
}
73+
}

0 commit comments

Comments
 (0)