diff --git a/.gitignore b/.gitignore index 547e183..41fd8ab 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /Godeps/_workspace vendor vendor.* +.idea \ No newline at end of file diff --git a/cmd/s3driver/Dockerfile b/cmd/s3driver/Dockerfile index ec9e2ea..bf261b6 100644 --- a/cmd/s3driver/Dockerfile +++ b/cmd/s3driver/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16-alpine as gobuild +FROM golang:1.16-alpine AS gobuild WORKDIR /build ADD . /build diff --git a/cmd/s3driver/Dockerfile.full b/cmd/s3driver/Dockerfile.full index 7dae6ab..21a2575 100644 --- a/cmd/s3driver/Dockerfile.full +++ b/cmd/s3driver/Dockerfile.full @@ -1,4 +1,4 @@ -FROM golang:1.16-alpine as gobuild +FROM golang:1.16-alpine AS gobuild WORKDIR /build ADD . /build @@ -6,7 +6,7 @@ ADD . /build RUN go get -d -v ./... RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver -FROM debian:buster-slim as s3backer +FROM debian:buster-slim AS s3backer ARG S3BACKER_VERSION=1.5.0 RUN apt-get update && apt-get install -y \ diff --git a/pkg/driver/controllerserver.go b/pkg/driver/controllerserver.go index 1a2d8ac..ad2a860 100644 --- a/pkg/driver/controllerserver.go +++ b/pkg/driver/controllerserver.go @@ -265,7 +265,7 @@ func sanitizeVolumeID(volumeID string) string { func volumeIDToBucketPrefix(volumeID string) (string, string) { // if the volumeID has a slash in it, this volume is // stored under a certain prefix within the bucket. - splitVolumeID := strings.Split(volumeID, "/") + splitVolumeID := strings.SplitN(volumeID, "/", 2) if len(splitVolumeID) > 1 { return splitVolumeID[0], splitVolumeID[1] } diff --git a/pkg/mounter/mounter.go b/pkg/mounter/mounter.go index d441fe1..f2bc943 100644 --- a/pkg/mounter/mounter.go +++ b/pkg/mounter/mounter.go @@ -68,7 +68,7 @@ func fuseMount(path string, command string, args []string) error { cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { - return fmt.Errorf("Error fuseMount command: %s\nargs: %s\noutput", command, args) + return fmt.Errorf("Error fuseMount command: %s\nargs: %s\noutput err %v", command, args, err) } return waitForMount(path, 10*time.Second)