From a98afe77e9de880bbd3735034d8ddf4649ae35f4 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Mon, 5 Jun 2023 14:29:01 +0800 Subject: [PATCH] chore(vendor): update backupstore ref: 6045 Signed-off-by: Chin-Ya Huang --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/longhorn/backupstore/s3/s3.go | 15 +++++++++++++-- vendor/modules.txt | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 040050569..491403e8a 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/uuid v1.3.0 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 - github.com/longhorn/backupstore v0.0.0-20230522064032-228beb21aa3c + github.com/longhorn/backupstore v0.0.0-20230606100406-4cf315c6b0df github.com/longhorn/go-iscsi-helper v0.0.0-20230214085945-21fed2bd6261 github.com/longhorn/sparse-tools v0.0.0-20230408015858-c849def39d3c github.com/moby/moby v23.0.2+incompatible diff --git a/go.sum b/go.sum index c3b8500b0..ec324cfcc 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/longhorn/backupstore v0.0.0-20230522064032-228beb21aa3c h1:YMibmCB4uCsYyg6MOJBBVILB4BZG6SJL0ZUs1MuaEus= -github.com/longhorn/backupstore v0.0.0-20230522064032-228beb21aa3c/go.mod h1:wiEYTbvxEAIUxAAY1DmvMeuFuGqwWmJTzfVhZiBKlNo= +github.com/longhorn/backupstore v0.0.0-20230606100406-4cf315c6b0df h1:a96kkaD1+4/EsGE9Atarp+K27gVIpsqOXGBtpGIxx8M= +github.com/longhorn/backupstore v0.0.0-20230606100406-4cf315c6b0df/go.mod h1:wiEYTbvxEAIUxAAY1DmvMeuFuGqwWmJTzfVhZiBKlNo= github.com/longhorn/go-iscsi-helper v0.0.0-20230214085945-21fed2bd6261 h1:XtxZ34rrCCP+WcC7Tv6miHPo1Xys0eUWtH4W0wDKjFM= github.com/longhorn/go-iscsi-helper v0.0.0-20230214085945-21fed2bd6261/go.mod h1:Pc949NvBbdV1zBFdbh4uC5Po8CuxQCwzxI+n7mIyGA0= github.com/longhorn/nsfilelock v0.0.0-20200723175406-fa7c83ad0003 h1:Jw9uANsGcHTxp6HcC++/vN17LfeuDmozHI2j6DoZf5E= diff --git a/vendor/github.com/longhorn/backupstore/s3/s3.go b/vendor/github.com/longhorn/backupstore/s3/s3.go index 78591ac47..73d232ee3 100644 --- a/vendor/github.com/longhorn/backupstore/s3/s3.go +++ b/vendor/github.com/longhorn/backupstore/s3/s3.go @@ -105,13 +105,24 @@ func (s *BackupStoreDriver) GetURL() string { } func (s *BackupStoreDriver) updatePath(path string) string { - return filepath.Join(s.path, path) + joinedPath := filepath.Join(s.path, path) + + // The filepath.Join removes the trailing slash when joining paths, so we + // need to check and add back the trailing slash if it exists in the input + // path. + if !strings.HasSuffix(path, "/") { + return joinedPath + } + return joinedPath + "/" } func (s *BackupStoreDriver) List(listPath string) ([]string, error) { var result []string - path := s.updatePath(listPath) + "/" + path := s.updatePath(listPath) + if !strings.HasSuffix(path, "/") { + path += "/" + } contents, prefixes, err := s.service.ListObjects(path, "/") if err != nil { log.WithError(err).Error("Failed to list s3") diff --git a/vendor/modules.txt b/vendor/modules.txt index c5811c537..4c3778e7f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -130,7 +130,7 @@ github.com/kr/pretty # github.com/kr/text v0.2.0 ## explicit github.com/kr/text -# github.com/longhorn/backupstore v0.0.0-20230522064032-228beb21aa3c +# github.com/longhorn/backupstore v0.0.0-20230606100406-4cf315c6b0df ## explicit; go 1.17 github.com/longhorn/backupstore github.com/longhorn/backupstore/azblob