Skip to content

Commit

Permalink
Merge pull request rook#13061 from parth-gr/external-pool-enable
Browse files Browse the repository at this point in the history
external: automatically init the rbd pool
  • Loading branch information
travisn authored Oct 23, 2023
2 parents dc5b362 + 40008bf commit 9d214b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions deploy/examples/create-external-cluster-resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,14 @@ def validate_rbd_pool(self):
f"The provided pool, '{self._arg_parser.rbd_data_pool_name}', does not exist"
)

def init_rbd_pool(self):
if isinstance(self.cluster, DummyRados):
return
rbd_pool_name = self._arg_parser.rbd_data_pool_name
ioctx = self.cluster.open_ioctx(rbd_pool_name)
rbd_inst = rbd.RBD()
rbd_inst.pool_init(ioctx, True)

def validate_rados_namespace(self):
rbd_pool_name = self._arg_parser.rbd_data_pool_name
rados_namespace = self._arg_parser.rados_namespace
Expand Down Expand Up @@ -1467,6 +1475,7 @@ def _gen_output_map(self):
self._arg_parser.k8s_cluster_name.lower()
) # always convert cluster name to lowercase characters
self.validate_rbd_pool()
self.init_rbd_pool()
self.validate_rados_namespace()
self._excluded_keys.add("K8S_CLUSTER_NAME")
self.get_cephfs_data_pool_details()
Expand Down

0 comments on commit 9d214b9

Please sign in to comment.