Add support for Object Tagging in LifeCycle configuration (#8880)

Fixes #8870

Co-Authored-By: Krishnan Parthasarathi <krisis@users.noreply.github.com>
This commit is contained in:
Nitish Tiwari
2020-02-06 13:20:10 +05:30
committed by GitHub
parent 45d725c0a3
commit e5951e30d0
18 changed files with 372 additions and 96 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
// Calculate the common prefix of all lifecycle rules
var prefixes []string
for _, rule := range l.Rules {
prefixes = append(prefixes, rule.Filter.Prefix)
prefixes = append(prefixes, rule.Prefix())
}
commonPrefix := lcp(prefixes)
@@ -143,7 +143,7 @@ func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
var objects []string
for _, obj := range res.Objects {
// Find the action that need to be executed
action := l.ComputeAction(obj.Name, obj.ModTime)
action := l.ComputeAction(obj.Name, obj.UserTags, obj.ModTime)
switch action {
case lifecycle.DeleteAction:
objects = append(objects, obj.Name)