fix list results returned for spark max-keys=2 listing (#19791)

This PR continues fix #19725 for some unhandled cases
This commit is contained in:
Poorna
2024-05-22 16:16:34 -07:00
committed by GitHub
parent 7c7650b7c3
commit 7d29030292
2 changed files with 46 additions and 10 deletions

View File

@@ -1647,12 +1647,17 @@ func (z *erasureServerPools) listObjectsGeneric(ctx context.Context, bucket, pre
}
}
}
if o.DeleteMarker {
switch {
case o.DeleteMarker:
loi.Objects = append(loi.Objects, ObjectInfo{Bucket: bucket, IsDir: true, Name: prefix})
return loi, nil
} else if len(li.Objects) == 1 {
case len(li.Objects) >= 1:
loi.Objects = append(loi.Objects, o)
loi.Prefixes = append(loi.Prefixes, path.Join(opts.Prefix, pfx))
if pfx != "" {
loi.Prefixes = append(loi.Prefixes, path.Join(opts.Prefix, pfx))
}
case len(li.Prefixes) > 0:
loi.Prefixes = append(loi.Prefixes, li.Prefixes...)
}
}
return loi, nil