From 436b3a05e94ea45fce4624442d544484dbf91155 Mon Sep 17 00:00:00 2001 From: peitingwei Date: Wed, 10 May 2023 15:04:01 +0800 Subject: [PATCH] s3 endpoint dont joint bucket --- hbr-raw/cmd/archive-raw.go | 1 + hbr-raw/cmd/restore-raw.go | 1 + hbr/cmd/archive.go | 1 + hbr/cmd/backup.go | 1 + hbr/cmd/restore.go | 1 + 5 files changed, 5 insertions(+) diff --git a/hbr-raw/cmd/archive-raw.go b/hbr-raw/cmd/archive-raw.go index ca75f0b..af9c780 100644 --- a/hbr-raw/cmd/archive-raw.go +++ b/hbr-raw/cmd/archive-raw.go @@ -54,6 +54,7 @@ func runArchive(cmd *cobra.Command, args []string) { Region: aws.String(region), Endpoint: aws.String(endpoint), Credentials: credentials.NewStaticCredentials(access_key, secret_key, ""), + S3ForcePathStyle: aws.Bool(true), }) if err != nil { fmt.Printf("Connect S3 Error!\n%v\n", err) diff --git a/hbr-raw/cmd/restore-raw.go b/hbr-raw/cmd/restore-raw.go index 08769fe..617ab2f 100644 --- a/hbr-raw/cmd/restore-raw.go +++ b/hbr-raw/cmd/restore-raw.go @@ -54,6 +54,7 @@ func runRestore(cmd *cobra.Command, args []string) { Region: aws.String(region), Endpoint: aws.String(endpoint), Credentials: credentials.NewStaticCredentials(access_key, secret_key, ""), + S3ForcePathStyle: aws.Bool(true), }) if err != nil { fmt.Printf("Connect S3 Error!\n%v\n", err) diff --git a/hbr/cmd/archive.go b/hbr/cmd/archive.go index 451dd90..4e2e200 100644 --- a/hbr/cmd/archive.go +++ b/hbr/cmd/archive.go @@ -68,6 +68,7 @@ func runArchive(cmd *cobra.Command, args []string) { Region: aws.String(region), Endpoint: aws.String(endpoint), Credentials: credentials.NewStaticCredentials(access_key, secret_key, ""), + S3ForcePathStyle: aws.Bool(true), }) if err != nil { fmt.Printf("Connect S3 Error!\n%v\n", err) diff --git a/hbr/cmd/backup.go b/hbr/cmd/backup.go index fb3d9a8..86c0e37 100644 --- a/hbr/cmd/backup.go +++ b/hbr/cmd/backup.go @@ -51,6 +51,7 @@ func runBackup(cmd *cobra.Command, args []string) { Region: aws.String(region), Endpoint: aws.String(endpoint), Credentials: credentials.NewStaticCredentials(access_key, secret_key, ""), + S3ForcePathStyle: aws.Bool(true), }) if err != nil { fmt.Printf("Connect S3 Error!\n%v\n", err) diff --git a/hbr/cmd/restore.go b/hbr/cmd/restore.go index 1b52c5f..6ec2eb4 100644 --- a/hbr/cmd/restore.go +++ b/hbr/cmd/restore.go @@ -52,6 +52,7 @@ func runRestore(cmd *cobra.Command, args []string) { Region: aws.String(region), Endpoint: aws.String(endpoint), Credentials: credentials.NewStaticCredentials(access_key, secret_key, ""), + S3ForcePathStyle: aws.Bool(true), }) if err != nil { fmt.Printf("Connect S3 Error!\n%v\n", err)