From 7c2bcfc4b09874772358f6ba2296eba5d793b3e0 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 7 Sep 2021 13:37:04 +0300 Subject: [PATCH] Do not pass empty region, use stderr for GeeseFS log --- pkg/mounter/geesefs.go | 5 ++++- pkg/mounter/rclone.go | 4 +++- pkg/mounter/s3fs.go | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/mounter/geesefs.go b/pkg/mounter/geesefs.go index 8a649ac..624c6ba 100644 --- a/pkg/mounter/geesefs.go +++ b/pkg/mounter/geesefs.go @@ -42,8 +42,11 @@ func (geesefs *geesefsMounter) Mount(source string, target string) error { fullPath := fmt.Sprintf("%s:%s", geesefs.meta.BucketName, geesefs.meta.Prefix) args := []string{ "--endpoint", geesefs.endpoint, - "--region", geesefs.region, "-o", "allow_other", + "--log-file", "/dev/stderr", + } + if geesefs.region != "" { + args = append(args, "--region", geesefs.region) } args = append(args, geesefs.meta.MountOptions...) args = append(args, fullPath, target) diff --git a/pkg/mounter/rclone.go b/pkg/mounter/rclone.go index ebcede0..eebc239 100644 --- a/pkg/mounter/rclone.go +++ b/pkg/mounter/rclone.go @@ -47,11 +47,13 @@ func (rclone *rcloneMounter) Mount(source string, target string) error { "--daemon", "--s3-provider=AWS", "--s3-env-auth=true", - fmt.Sprintf("--s3-region=%s", rclone.region), fmt.Sprintf("--s3-endpoint=%s", rclone.url), "--allow-other", "--vfs-cache-mode=writes", } + if rclone.region != "" { + args = append(args, fmt.Sprintf("--s3-region=%s", rclone.region)) + } args = append(args, rclone.meta.MountOptions...) os.Setenv("AWS_ACCESS_KEY_ID", rclone.accessKeyID) os.Setenv("AWS_SECRET_ACCESS_KEY", rclone.secretAccessKey) diff --git a/pkg/mounter/s3fs.go b/pkg/mounter/s3fs.go index 9e38c7c..644aed6 100644 --- a/pkg/mounter/s3fs.go +++ b/pkg/mounter/s3fs.go @@ -45,10 +45,12 @@ func (s3fs *s3fsMounter) Mount(source string, target string) error { target, "-o", "use_path_request_style", "-o", fmt.Sprintf("url=%s", s3fs.url), - "-o", fmt.Sprintf("endpoint=%s", s3fs.region), "-o", "allow_other", "-o", "mp_umask=000", } + if s3fs.region != "" { + args = append(args, "-o", fmt.Sprintf("endpoint=%s", s3fs.region)) + } args = append(args, s3fs.meta.MountOptions...) return fuseMount(target, s3fsCmd, args) }