lifecycle: Support tags with special characters (#14906)

Object tags can have special characters such as whitespace. However
the current code doesn't properly consider those characters while
evaluating the lifecycle document.

ObjectInfo.UserTags contains an url encoded form of object tags
(e.g. key+1=val)

This commit fixes the issue by using the tags package to parse object tags.
This commit is contained in:
Anis Elleuch
2022-05-14 18:25:55 +01:00
committed by GitHub
parent f28a8eca91
commit b0e2c2da78
3 changed files with 44 additions and 17 deletions

View File

@@ -259,7 +259,7 @@ func (lc Lifecycle) FilterActionableRules(obj ObjectOpts) []Rule {
continue
}
if rule.Filter.TestTags(strings.Split(obj.UserTags, "&")) {
if rule.Filter.TestTags(obj.UserTags) {
rules = append(rules, rule)
}
if !rule.Transition.IsNull() {