mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
fix: listObjectVersions Include object in marker (#11562)
ListObjectVersions would skip past the object in the marker when version id is specified. Make `listPath` return the object with the marker and truncate it if not needed. Avoid having to parse unintended objects to find a version marker.
This commit is contained in:
@@ -442,6 +442,17 @@ func (m *metaCacheEntriesSorted) forwardTo(s string) {
|
||||
m.o = m.o[idx:]
|
||||
}
|
||||
|
||||
// forwardPast will truncate m so only entries that are after s is in the list.
|
||||
func (m *metaCacheEntriesSorted) forwardPast(s string) {
|
||||
if s == "" {
|
||||
return
|
||||
}
|
||||
idx := sort.Search(len(m.o), func(i int) bool {
|
||||
return m.o[i].name > s
|
||||
})
|
||||
m.o = m.o[idx:]
|
||||
}
|
||||
|
||||
// merge will merge other into m.
|
||||
// If the same entries exists in both and metadata matches only one is added,
|
||||
// otherwise the entry from m will be placed first.
|
||||
|
||||
Reference in New Issue
Block a user