Skip to content

Commit c78ff81

Browse files
committed
Updated MooseFS client to version 4.58.1
1 parent 929148e commit c78ff81

File tree

9 files changed

+74
-28
lines changed

9 files changed

+74
-28
lines changed

.github/workflows/build-docker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
REGISTRY_IMAGE: moosefs/moosefs-csi
10-
MFS_CLIENT: 4.58.0
10+
MFS_CLIENT: 4.58.1
1111
CSI_VERSION: 0.9.8
1212

1313
jobs:

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
MFS_VERSION = "4.58.0"
15+
MFS_VERSION = "4.58.1"
1616
CSI_VERSION ?= "0.9.8"
1717

1818
MFS_TAG=$(CSI_VERSION)-$(MFS_VERSION)
@@ -30,7 +30,7 @@ compile:
3030

3131
build-dev:
3232
@echo "==> Building DEV CSI images"
33-
@docker build --no-cache -t moosefs/$(NAME):dev -t moosefs/$(NAME):$(DEV_TAG) --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=dev cmd/moosefs-csi-plugin
33+
@docker build --no-cache -t moosefs/$(NAME):dev -t moosefs/$(NAME):$(DEV_TAG) --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=dev --file cmd/moosefs-csi-plugin/dev.Dockerfile .
3434

3535
push-dev:
3636
@echo "==> Publishing DEV CSI image on hub.docker.com: moosefs/$(NAME):$(DEV_TAG)"
@@ -47,7 +47,7 @@ push-prod:
4747

4848
dev-buildx:
4949
@echo "==> Using buildx to build and publish dev image"
50-
@docker buildx build --no-cache --push --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=dev -t moosefs/$(NAME):dev -t moosefs/$(NAME):$(DEV_TAG) cmd/moosefs-csi-plugin
50+
@docker buildx build --no-cache --push --platform linux/amd64,linux/arm64,linux/arm/v7 --build-arg MFS_TAG=v$(MFS_VERSION) --build-arg CSI_TAG=dev -t moosefs/$(NAME):dev -t moosefs/$(NAME):$(DEV_TAG) --file cmd/moosefs-csi-plugin/dev.Dockerfile .
5151

5252
prod-buildx:
5353
@echo "==> Using buildx to build and publish production image"

cmd/moosefs-csi-plugin/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
ARG CSI_TAG="v0.9.8"
16-
ARG MFS_TAG="v4.58.0"
16+
ARG MFS_TAG="v4.58.1"
1717

1818
#Build MooseFS CSI driver from source
1919
FROM golang:1.25-alpine3.22 AS csibuilder
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) 2025 Saglabs SA. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG CSI_TAG="v0.9.8"
16+
ARG MFS_TAG="v4.58.1"
17+
18+
#Build MooseFS CSI driver from source
19+
FROM golang:1.25-alpine3.22 AS csibuilder
20+
WORKDIR /build
21+
ARG CSI_TAG
22+
RUN apk add --update git
23+
COPY ./ /build
24+
RUN CGO_ENABLED=0 GOCACHE=/tmp/go-cache GOOS=linux go build -a -o /build/moosefs-csi-plugin cmd/moosefs-csi-plugin/main.go
25+
26+
# MooseFS client is required for the CSI driver to mount volumes
27+
FROM moosefs/mfsbuilder:alpine3.22 AS mfsbuilder
28+
WORKDIR /moosefs
29+
ARG MFS_TAG
30+
RUN git clone --depth 1 --branch ${MFS_TAG} https://github.com/moosefs/moosefs.git /moosefs
31+
RUN autoreconf -f -i
32+
RUN ./configure --prefix=/usr --mandir=/share/man --sysconfdir=/etc --localstatedir=/var/lib --with-default-user=mfs --with-default-group=mfs --disable-mfsbdev --disable-mfsmaster --disable-mfschunkserver --disable-mfsmetalogger --disable-mfsnetdump --disable-mfscgi --disable-mfscgiserv --disable-mfscli
33+
RUN cd /moosefs/mfsclient && make DESTDIR=/tmp/ install
34+
35+
#Build CSI plugin container
36+
FROM alpine:3.22
37+
RUN apk add --update fuse3-libs findmnt
38+
COPY --from=csibuilder /build/moosefs-csi-plugin /bin/moosefs-csi-plugin
39+
COPY --from=mfsbuilder /tmp/usr/bin /usr/bin
40+
RUN ["ln", "-s", "/usr/bin/mfsmount", "/usr/sbin/mount.moosefs"]
41+
ENTRYPOINT ["/bin/moosefs-csi-plugin"]

deploy/csi-moosefs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ spec:
227227
capabilities:
228228
add: ["SYS_ADMIN"]
229229
allowPrivilegeEscalation: true
230-
image: ghcr.io/moosefs/moosefs-csi:0.9.8-4.58.0
230+
image: moosefs/moosefs-csi:0.9.8-4.58.1
231231
args:
232232
- "--mode=controller"
233233
- "--csi-endpoint=$(CSI_ENDPOINT)"
@@ -326,7 +326,7 @@ spec:
326326
capabilities:
327327
add: ["SYS_ADMIN"]
328328
allowPrivilegeEscalation: true
329-
image: ghcr.io/moosefs/moosefs-csi:0.9.8-4.58.0
329+
image: moosefs/moosefs-csi:0.9.8-4.58.1
330330
args:
331331
- "--mode=node"
332332
- "--csi-endpoint=$(CSI_ENDPOINT)"

driver/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (cs *ControllerService) CreateVolume(ctx context.Context, req *csi.CreateVo
7979
if req.Name == "" {
8080
return nil, status.Error(codes.InvalidArgument, "CreateVolume: Name must be provided")
8181
}
82-
if req.VolumeCapabilities == nil || len(req.VolumeCapabilities) == 0 {
82+
if len(req.VolumeCapabilities) == 0 {
8383
return nil, status.Error(codes.InvalidArgument, "CreateVolume: Volume capabilities must be provided")
8484
}
8585
requestedQuota, err := getRequestCapacity(req.CapacityRange)

driver/mfs_handler.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@ import (
3030
)
3131

3232
const (
33-
fsType = "moosefs"
34-
newVolumeMode = 0755
35-
getQuotaCmd = "mfsgetquota"
36-
setQuotaCmd = "mfssetquota"
37-
quotaLimitType = "-L"
38-
quotaLimitRow = 2
39-
quotaLimitCol = 3
40-
logsDirName = "logs"
41-
volumesDirName = "volumes"
42-
mvolumesDirName = "mount_volumes"
43-
mntDir = "/mnt"
33+
fsType = "moosefs"
34+
newVolumeMode = 0755
35+
getQuotaCmd = "mfsgetquota"
36+
setQuotaCmd = "mfssetquota"
37+
quotaLimitType = "-L"
38+
logsDirName = "logs"
39+
volumesDirName = "volumes"
40+
mntDir = "/mnt"
4441
)
4542

4643
// todo(ad): in future possibly add more options (mount options?)
@@ -210,15 +207,18 @@ func parseMfsQuotaToolsOutput(output string) (int64, error) {
210207
lines := strings.Split(output, "\n")
211208
ll := len(lines)
212209

213-
if ll == 8 {
214-
// new mfsgetquota output format
210+
switch ll {
211+
case 8:
212+
// mfssetquota new format output
215213
cols = strings.Split(lines[ll-4], "|")
216214
s = strings.TrimSpace(cols[4])
217-
} else if ll == 6 {
218-
// old mfsgetquota output format
215+
case 6:
216+
// mfsgetquota old format output
219217
cols := strings.Split(lines[ll-4], "|")
220218
s = strings.TrimSpace(cols[3])
221-
} else {
219+
case 0:
220+
return -1, errors.New("error while parsing mfsgetquota tool output (empty output)")
221+
default:
222222
return -1, fmt.Errorf("error while parsing mfsgetquota tool output (unexpected number of lines); output: %s", output)
223223
}
224224

go.mod

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
module github.com/moosefs/moosefs-csi
22

3-
go 1.14
3+
go 1.25
44

55
require (
66
github.com/container-storage-interface/spec v1.4.0
77
github.com/golang/protobuf v1.4.3
88
github.com/sirupsen/logrus v1.8.0
9+
google.golang.org/grpc v1.36.0
10+
gopkg.in/natefinch/lumberjack.v2 v2.0.0
11+
)
12+
13+
require (
14+
github.com/magefile/mage v1.10.0 // indirect
915
golang.org/x/net v0.0.0-20200320220750-118fecf932d8 // indirect
1016
golang.org/x/sys v0.0.0-20200321134203-328b4cd54aae // indirect
1117
golang.org/x/text v0.3.2 // indirect
12-
google.golang.org/grpc v1.36.0
13-
gopkg.in/natefinch/lumberjack.v2 v2.0.0
18+
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
19+
google.golang.org/protobuf v1.25.0 // indirect
1420
gopkg.in/yaml.v2 v2.2.5 // indirect
1521
)

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
9696
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
9797
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
9898
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
99-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
10099
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
101100
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
102101
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=

0 commit comments

Comments
 (0)