ListObjects: Filter lifecycle expired objects (#14606)

For ListObjects and ListObjectsV2 perform lifecycle checks on 
all objects before returning. This will filter out objects that are 
pending lifecycle expiration.

Bonus: Cheaper server pool conflict resolution by not converting to FileInfo.
This commit is contained in:
Klaus Post
2022-03-22 12:39:45 -07:00
committed by GitHub
parent 8eecdc6d1f
commit 2ac54e5a7b
4 changed files with 76 additions and 7 deletions

View File

@@ -32,6 +32,7 @@ import (
"time"
jsoniter "github.com/json-iterator/go"
"github.com/minio/minio/internal/bucket/lifecycle"
"github.com/minio/minio/internal/color"
"github.com/minio/minio/internal/hash"
"github.com/minio/minio/internal/logger"
@@ -96,6 +97,11 @@ type listPathOptions struct {
// pool and set of where the cache is located.
pool, set int
// lcFilter performs filtering based on lifecycle.
// This will filter out objects if the most recent version should be deleted by lifecycle.
// Is not transferred across request calls.
lcFilter *lifecycle.Lifecycle
}
func init() {