mirror of
https://github.com/minio/minio.git
synced 2025-02-04 02:15:59 -05:00
fix: de-duplicate conflicting object names on namespace (#15772)
This commit is contained in:
parent
45edd27ad7
commit
2aac50571d
@ -22,6 +22,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -684,7 +685,14 @@ func mergeEntryChannels(ctx context.Context, in []chan metaCacheEntry, out chan<
|
|||||||
bestIdx = otherIdx
|
bestIdx = otherIdx
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if best.name == other.name {
|
// We should make sure to avoid objects and directories
|
||||||
|
// of this fashion such as
|
||||||
|
// - foo-1
|
||||||
|
// - foo-1/
|
||||||
|
// we should avoid this situation by making sure that
|
||||||
|
// we compare the `foo-1/` after path.Clean() to
|
||||||
|
// de-dup the entries.
|
||||||
|
if path.Clean(best.name) == path.Clean(other.name) {
|
||||||
if compareMeta(best, other) {
|
if compareMeta(best, other) {
|
||||||
// Replace "best"
|
// Replace "best"
|
||||||
if err := selectFrom(bestIdx); err != nil {
|
if err := selectFrom(bestIdx); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user