Merge pull request #53073 from kchheda3/wip-filter-noti-uid

rgw/notification: Filter topic list based on uid

reviewed-by: yuvalif
This commit is contained in:
Yuval Lifshitz 2023-09-11 17:21:47 +03:00 committed by GitHub
commit f53f3aeba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -78,7 +78,7 @@ following command:
.. prompt:: bash #
radosgw-admin topic list [--tenant={tenant}]
radosgw-admin topic list [--tenant={tenant}] [--uid={user}]
Fetch the configuration of a specific topic by running the following command:

View File

@ -10517,6 +10517,16 @@ next:
cerr << "ERROR: could not get topics: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
if (!rgw::sal::User::empty(user)) {
for (auto it = result.topics.cbegin(); it != result.topics.cend();) {
const auto& topic = it->second;
if (user->get_id() != topic.user) {
result.topics.erase(it++);
} else {
++it;
}
}
}
encode_json("result", result, formatter.get());
formatter->flush(cout);
}