Skip to content

Commit

Permalink
APPS-1469-azure-list-objects-fix
Browse files Browse the repository at this point in the history
- fix ListObject method for azure and gcp
  • Loading branch information
filkeith committed Jan 22, 2025
1 parent 590d729 commit 412150d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions io/azure/blob/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ func (r *Reader) checkRestoreDirectory(ctx context.Context, path string) error {

// ListObjects list all object in the path.
func (r *Reader) ListObjects(ctx context.Context, path string) ([]string, error) {
if !strings.HasSuffix(path, "/") {
path += "/"
}

result := make([]string, 0)

pager := r.client.NewListBlobsFlatPager(r.containerName, &azblob.ListBlobsFlatOptions{
Expand Down
4 changes: 4 additions & 0 deletions io/gcp/storage/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ func (r *Reader) checkRestoreDirectory(ctx context.Context, path string) error {

// ListObjects list all object in the path.
func (r *Reader) ListObjects(ctx context.Context, path string) ([]string, error) {
if !strings.HasSuffix(path, "/") {
path += "/"
}

result := make([]string, 0)

it := r.bucketHandle.Objects(ctx, &storage.Query{
Expand Down

0 comments on commit 412150d

Please sign in to comment.