From 16e0a83b1a3b078462360068e82ee33c0f3b39ac Mon Sep 17 00:00:00 2001 From: sys-liqian Date: Fri, 22 Dec 2023 05:52:00 -0500 Subject: [PATCH] fix: :bug: fix pod mount webdav server error fix pod mount webdav server error --- Dockerfile | 4 ++-- pkg/webdav/node.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8342e6a..f4563d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ubuntu:20.04 +FROM centos:centos7.9.2009 ARG binary=./bin/webdavplugin COPY ${binary} /webdavplugin -RUN apt update && apt install -y davfs2=1.5.5-1 +RUN yum install epel-release -y && yum update -y && yum install davfs2 -y ENTRYPOINT ["/webdavplugin"] \ No newline at end of file diff --git a/pkg/webdav/node.go b/pkg/webdav/node.go index 46613b8..83d822f 100644 --- a/pkg/webdav/node.go +++ b/pkg/webdav/node.go @@ -19,7 +19,6 @@ package webdav import ( "context" "os" - "path/filepath" "strings" "github.com/container-storage-interface/spec/lib/go/csi" @@ -84,7 +83,7 @@ func (n *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublish return &csi.NodePublishVolumeResponse{}, nil } - sourcePath := filepath.Join(address, subDir) + sourcePath := strings.Join([]string{address, subDir}, "/") stdin := []string{req.GetSecrets()[secretUsernameKey], req.GetSecrets()[secretPasswordKey]} klog.V(2).Infof("NodePublishVolume: volumeID(%v) source(%s) targetPath(%s) mountflags(%v)", volumeID, sourcePath, targetPath, mountOptions) err = n.mounter.MountSensitiveWithStdin(sourcePath, targetPath, fstype, mountOptions, nil, stdin)