From 3e13de0340e805ee5c8260c390a52bb00b7c8997 Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 21 Jul 2023 15:14:10 +0800 Subject: [PATCH] cmd/sync: sync custom endpoint env without mount point (#3922) --- cmd/sync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/sync.go b/cmd/sync.go index 977178a45699..2560a54394f6 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -22,6 +22,7 @@ import ( "net/http" _ "net/http/pprof" "net/url" + "os" "path/filepath" "regexp" "runtime" @@ -315,6 +316,9 @@ func createSyncStorage(uri string, conf *sync.Config) (object.ObjectStorage, err if err != nil { return nil, fmt.Errorf("unescape %s: %s", u.Host, err) } + if os.Getenv(endpoint) != "" { + conf.Env[endpoint] = os.Getenv(endpoint) + } } else if !conf.NoHTTPS && supportHTTPS(name, u.Host) { endpoint = "https://" + u.Host } else {