Skip to content

Commit

Permalink
Remote Path Suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jancis committed Jun 14, 2019
1 parent 8ab4083 commit 6e991ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/kubernetes/rclone-secret-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: rclone-secret
namespace: csi-rclone
type: Opaque
stringData:
remote: "s3"
Expand Down
6 changes: 6 additions & 0 deletions pkg/rclone/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func extractFlags(volumeContext map[string]string, secret *v1.Secret) (string, s

// Secret values are default, gets merged and overriden by corresponding PV values
if secret.Data != nil && len(secret.Data) > 0 {

// Needs byte to string casting for map values
for k, v := range secret.Data {
flags[k] = string(v)
Expand All @@ -105,6 +106,11 @@ func extractFlags(volumeContext map[string]string, secret *v1.Secret) (string, s
remote := flags["remote"]
remotePath := flags["remotePath"]

if remotePathSuffix, ok := flags["remotePathSuffix"]; ok {
remotePath = remotePath + remotePathSuffix
delete(flags, "remotePathSuffix")
}

delete(flags, "remote")
delete(flags, "remotePath")

Expand Down

0 comments on commit 6e991ef

Please sign in to comment.