mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
lifecycle: Consider multiple tags filtering (#9775)
* lifecycle: Consider multiple tags filtering * lifecycle: Disallow duplicated Key/Value xml in <Tag>
This commit is contained in:
@@ -104,15 +104,12 @@ func (lc Lifecycle) FilterActionableRules(objName, objTags string) []Rule {
|
||||
if rule.Status == Disabled {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(objName, rule.Prefix()) {
|
||||
tags := rule.Tags()
|
||||
if tags != "" {
|
||||
if strings.Contains(objTags, tags) {
|
||||
rules = append(rules, rule)
|
||||
}
|
||||
} else {
|
||||
rules = append(rules, rule)
|
||||
}
|
||||
if !strings.HasPrefix(objName, rule.Prefix()) {
|
||||
continue
|
||||
}
|
||||
tags := strings.Split(objTags, "&")
|
||||
if rule.Filter.TestTags(tags) {
|
||||
rules = append(rules, rule)
|
||||
}
|
||||
}
|
||||
return rules
|
||||
|
||||
Reference in New Issue
Block a user