While filter prefix is the latest version which AWS suggests users use.
Fixes: https://tracker.ceph.com/issues/45144
Signed-off-by: zhang Shaowen <zhangshaowen_yewu@cmss.chinamobile.com>
for (const auto& ri : rule_map) {
const auto& rule = ri.second;
auto& id = rule.get_id();
- auto& prefix = rule.get_prefix();
auto& filter = rule.get_filter();
+ auto& prefix = filter.has_prefix() ? filter.get_prefix(): rule.get_prefix();
auto& expiration = rule.get_expiration();
auto& noncur_expiration = rule.get_noncur_expiration();
if(! prefix.empty()) {
if (! boost::starts_with(obj_key.name, prefix))
- continue;
+ continue;
}
if (filter.has_tags()) {