Merge pull request #54903 from cbodley/wip-63829

radosgw-admin: 'zone set' won't overwrite existing default-placement

Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
This commit is contained in:
Casey Bodley 2024-01-04 20:19:08 +00:00 committed by GitHub
commit fe747f40fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1035,10 +1035,12 @@ int create_zone(const DoutPrefixProvider* dpp, optional_yield y,
}
// add default placement with empty pool name
RGWZonePlacementInfo placement;
rgw_pool pool;
auto& placement = info.placement_pools["default-placement"];
placement.storage_classes.set_storage_class(
RGW_STORAGE_CLASS_STANDARD, &pool, nullptr);
// don't overwrite if it already exists
info.placement_pools.emplace("default-placement", std::move(placement));
// build a set of all pool names used by other zones
std::set<rgw_pool> pools;