diff --git a/example/kubernetes/rclone-secret-example.yaml b/example/kubernetes/rclone-secret-example.yaml index ea5ef09..abeb18c 100644 --- a/example/kubernetes/rclone-secret-example.yaml +++ b/example/kubernetes/rclone-secret-example.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: rclone-secret + namespace: csi-rclone type: Opaque stringData: remote: "s3" diff --git a/pkg/rclone/nodeserver.go b/pkg/rclone/nodeserver.go index 1dfb6bd..4dea5c4 100644 --- a/pkg/rclone/nodeserver.go +++ b/pkg/rclone/nodeserver.go @@ -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) @@ -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")