From b412e819771fe63fcd458a1f2cb246187b41401e Mon Sep 17 00:00:00 2001 From: Cyrill Troxler Date: Sat, 21 Jul 2018 16:36:39 +0200 Subject: [PATCH] Fix s3ql unmount --- cmd/s3driver/Dockerfile.s3ql | 2 +- pkg/s3/mounter_s3ql.go | 5 +---- pkg/s3/nodeserver.go | 4 ++-- test/Dockerfile | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cmd/s3driver/Dockerfile.s3ql b/cmd/s3driver/Dockerfile.s3ql index d73f638..da52a29 100644 --- a/cmd/s3driver/Dockerfile.s3ql +++ b/cmd/s3driver/Dockerfile.s3ql @@ -5,7 +5,7 @@ ARG S3QL_VERSION=release-2.28 RUN apt-get update && \ apt-get install -y \ - s3fs wget python3 python3-setuptools \ + s3fs wget psmisc python3 python3-setuptools \ python3-dev python3-pip python3-llfuse pkg-config \ sqlite3 libsqlite3-dev python3-apsw cython && \ rm -rf /var/lib/apt/lists/* diff --git a/pkg/s3/mounter_s3ql.go b/pkg/s3/mounter_s3ql.go index 0932da3..df4ad91 100644 --- a/pkg/s3/mounter_s3ql.go +++ b/pkg/s3/mounter_s3ql.go @@ -80,10 +80,7 @@ func (s3ql *s3qlMounter) Mount(targetPath string) error { } func (s3ql *s3qlMounter) Unmount(targetPath string) error { - args := []string{ - targetPath, - } - return s3qlCmd(s3qlCmdUnmount, append(args, s3ql.options...), nil) + return s3qlCmd(s3qlCmdUnmount, []string{targetPath}, nil) } func s3qlCmd(s3qlCmd string, args []string, stdin io.Reader) error { diff --git a/pkg/s3/nodeserver.go b/pkg/s3/nodeserver.go index a974db4..c6dad2e 100644 --- a/pkg/s3/nodeserver.go +++ b/pkg/s3/nodeserver.go @@ -105,14 +105,14 @@ func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu if err != nil { return nil, err } - mounter.Unmount(req.GetTargetPath()) - if err != nil { + if err := mounter.Unmount(req.GetTargetPath()); err != nil { return nil, status.Error(codes.Internal, err.Error()) } glog.V(4).Infof("s3: bucket %s has been unmounted.", req.GetVolumeId()) return &csi.NodeUnpublishVolumeResponse{}, nil } + func (ns *nodeServer) NodeStageVolume( ctx context.Context, req *csi.NodeStageVolumeRequest) ( diff --git a/test/Dockerfile b/test/Dockerfile index 3f0a12b..c128ab4 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -5,7 +5,7 @@ ARG S3QL_VERSION=release-2.28 RUN apt-get update && \ apt-get install -y \ - s3fs wget python3 python3-setuptools \ + s3fs wget psmisc python3 python3-setuptools \ python3-dev python3-pip python3-llfuse pkg-config \ sqlite3 libsqlite3-dev python3-apsw cython && \ rm -rf /var/lib/apt/lists/*