Default pool is not being picked up when providing only image name
during map/unmap. However, if the pool name is provided manually map/unmap
works as expected.
Fixes: https://tracker.ceph.com/issues/50522
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
(cherry picked from commit
987e017f20dc419f45f222a35c9ccca79551af7d)
return r;
}
+ if (pool_name.empty()) {
+ // connect to the cluster to get the default pool
+ librados::Rados rados;
+ r = utils::init_rados(&rados);
+ if (r < 0) {
+ return r;
+ }
+
+ utils::normalize_pool_name(&pool_name);
+ }
+
spec->append(pool_name);
spec->append("/");
if (!nspace_name.empty()) {
return r;
}
+ if (pool_name.empty()) {
+ // connect to the cluster to get the default pool
+ librados::Rados rados;
+ r = utils::init_rados(&rados);
+ if (r < 0) {
+ return r;
+ }
+
+ utils::normalize_pool_name(&pool_name);
+ }
+
spec->append(pool_name);
spec->append("/");
if (!nspace_name.empty()) {