extend previous PRs behavior to WalkVersions as well
This commit is contained in:
parent
ca0c9a2cfd
commit
6399e5e589
|
@ -54,6 +54,7 @@ type Entry struct {
|
|||
Trigger string `json:"trigger,omitempty"`
|
||||
}
|
||||
|
||||
// NewEntry initializes a new audit entry
|
||||
func NewEntry(deploymentID string) Entry {
|
||||
return Entry{
|
||||
Version: Version,
|
||||
|
|
|
@ -977,6 +977,10 @@ func (s *xlStorage) WalkVersions(ctx context.Context, volume, dirPath, marker st
|
|||
dirObjects := make(map[string]struct{})
|
||||
for walkResult := range walkResultCh {
|
||||
var fiv FileInfoVersions
|
||||
if HasSuffix(walkResult.entry, SlashSeparator) && walkResult.emptyDir {
|
||||
// Avoid listing empty directory, they are not supposed to exist
|
||||
continue
|
||||
}
|
||||
if HasSuffix(walkResult.entry, SlashSeparator) && !walkResult.emptyDir {
|
||||
_, dirObj := dirObjects[walkResult.entry]
|
||||
if dirObj {
|
||||
|
@ -1084,7 +1088,8 @@ func (s *xlStorage) Walk(ctx context.Context, volume, dirPath, marker string, re
|
|||
if HasSuffix(walkResult.entry, SlashSeparator) && walkResult.emptyDir {
|
||||
// Avoid listing empty directory, they are not supposed to exist
|
||||
continue
|
||||
} else if HasSuffix(walkResult.entry, SlashSeparator) && !walkResult.emptyDir {
|
||||
}
|
||||
if HasSuffix(walkResult.entry, SlashSeparator) && !walkResult.emptyDir {
|
||||
_, dirObj := dirObjects[walkResult.entry]
|
||||
if dirObj {
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue