make sure to pass Lifecycle if set for List filtering (#14722)
PR #14606 never really passed the Lifecycle filter down to the listing callers to ensure skipping the entries.
This commit is contained in:
@@ -291,9 +291,9 @@ func (z *erasureServerPools) listMerged(ctx context.Context, o listPathOptions,
|
||||
mu.Unlock()
|
||||
|
||||
// Do lifecycle filtering.
|
||||
if o.lcFilter != nil {
|
||||
if o.Lifecycle != nil {
|
||||
filterIn := make(chan metaCacheEntry, 10)
|
||||
go filterLifeCycle(ctx, o.Bucket, o.lcFilter, filterIn, results)
|
||||
go filterLifeCycle(ctx, o.Bucket, o.Lifecycle, filterIn, results)
|
||||
// Replace results.
|
||||
results = filterIn
|
||||
}
|
||||
@@ -381,6 +381,8 @@ func filterLifeCycle(ctx context.Context, bucket string, lc *lifecycle.Lifecycle
|
||||
action := evalActionFromLifecycle(ctx, *lc, objInfo, false)
|
||||
switch action {
|
||||
case lifecycle.DeleteVersionAction, lifecycle.DeleteAction:
|
||||
fallthrough
|
||||
case lifecycle.DeleteRestoredAction, lifecycle.DeleteRestoredVersionAction:
|
||||
// Skip this entry.
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user