Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Fixed the issue that the pod could not start mounting pvc when the prefix parameter contained a slash "/" #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/Godeps/_workspace
vendor
vendor.*
.idea
2 changes: 1 addition & 1 deletion cmd/s3driver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16-alpine as gobuild
FROM golang:1.16-alpine AS gobuild

WORKDIR /build
ADD . /build
Expand Down
4 changes: 2 additions & 2 deletions cmd/s3driver/Dockerfile.full
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.16-alpine as gobuild
FROM golang:1.16-alpine AS gobuild

WORKDIR /build
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 \
Expand Down
2 changes: 1 addition & 1 deletion pkg/driver/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/mounter/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down