Skip to content

Commit

Permalink
Fix Azure walker (#5066)
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-har authored Jan 22, 2023
1 parent dfd1590 commit 53b77fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/ingest/store/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,22 @@ func (a *azureBlobWalker) Walk(ctx context.Context, storageURI *url.URL, op Walk
container := a.client.NewContainerClient(qk.ContainerName)
listBlob := container.NewListBlobsFlatPager(&azblob.ListBlobsFlatOptions{
Prefix: &prefix,
Marker: &op.ContinuationToken,
})

for listBlob.More() {
resp, err := listBlob.NextPage(ctx)
if err != nil {
return err
}

for _, blobInfo := range resp.Segment.BlobItems {
// skipping everything in the page which is before 'After' (without forgetting the possible empty string key!)
if op.After != "" && *blobInfo.Name <= op.After {
continue
}
if resp.Marker != nil {
a.mark.ContinuationToken = *resp.Marker
}
a.mark.LastKey = *blobInfo.Name
if err := walkFn(ObjectStoreEntry{
FullKey: *blobInfo.Name,
Expand Down

0 comments on commit 53b77fb

Please sign in to comment.