]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: 'zone set' won't overwrite existing default-placement 55061/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 14 Dec 2023 18:38:22 +0000 (13:38 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 4 Jan 2024 20:38:07 +0000 (15:38 -0500)
Fixes: https://tracker.ceph.com/issues/63829
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d785add11c38411a0b2f5933cc9581c00cc51ac0)

src/rgw/driver/rados/rgw_zone.cc

index ed09f24f6c24b1c9e25d070edd0a5fa23a1ee732..5c3f55b3dd88303c32c93b446e060adaf15ce3d6 100644 (file)
@@ -1005,10 +1005,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;