Skip to content

Commit 5eaef96

Browse files
authored
fix(azure): remove properties and fix prefix (#2209)
Remove properties from azure blob response fix azure blob prefix filter: prefix should be empty if it is "/"
1 parent b5626b2 commit 5eaef96

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/azure_blob/driver.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ func (d *AzureBlob) Drop(ctx context.Context) error {
8585
// List retrieves blobs and directories under the specified path.
8686
func (d *AzureBlob) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
8787
prefix := ensureTrailingSlash(dir.GetPath())
88+
if prefix == "/" {
89+
prefix = ""
90+
}
8891

8992
pager := d.containerClient.NewListBlobsHierarchyPager("/", &container.ListBlobsHierarchyOptions{
9093
Prefix: &prefix,
@@ -100,10 +103,11 @@ func (d *AzureBlob) List(ctx context.Context, dir model.Obj, args model.ListArgs
100103
// Process directories
101104
for _, blobPrefix := range page.Segment.BlobPrefixes {
102105
objs = append(objs, &model.Object{
103-
Name: path.Base(strings.TrimSuffix(*blobPrefix.Name, "/")),
104-
Path: *blobPrefix.Name,
105-
Modified: *blobPrefix.Properties.LastModified,
106-
Ctime: *blobPrefix.Properties.CreationTime,
106+
Name: path.Base(strings.TrimSuffix(*blobPrefix.Name, "/")),
107+
Path: *blobPrefix.Name,
108+
// Azure does not support properties now.
109+
//Modified: *blobPrefix.Properties.LastModified,
110+
//Ctime: *blobPrefix.Properties.CreationTime,
107111
IsFolder: true,
108112
})
109113
}

0 commit comments

Comments
 (0)