]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Addressing some of Ali comments
authorRedouane Kachach <rkachach@redhat.com>
Tue, 11 Oct 2022 10:06:21 +0000 (12:06 +0200)
committerAdam King <adking@redhat.com>
Wed, 5 Apr 2023 17:31:07 +0000 (13:31 -0400)
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 83b0ef406df3a22dccf36c9e9bd2c75c6f20ebd4)

doc/cephadm/services/rgw.rst
doc/mgr/rgw.rst
src/pybind/mgr/rgw/module.py
src/python-common/ceph/deployment/service_spec.py
src/python-common/ceph/rgw/rgwam_core.py

index e9aee3c6b7fc6ae10059b00104a87b390d3efd11..2c1c06261f48fa0bdb8b143a274b7b119bcd8eea 100644 (file)
@@ -91,15 +91,15 @@ you can use :ref:`mgr-rgw-module` or manually using something like:
 
 .. prompt:: bash #
 
-  radosgw-admin realm create --rgw-realm=<realm-name> --default
+  radosgw-admin realm create --rgw-realm=<realm-name>
 
 .. prompt:: bash #
 
-  radosgw-admin zonegroup create --rgw-zonegroup=<zonegroup-name>  --master --default
+  radosgw-admin zonegroup create --rgw-zonegroup=<zonegroup-name>  --master
 
 .. prompt:: bash #
 
-  radosgw-admin zone create --rgw-zonegroup=<zonegroup-name> --rgw-zone=<zone-name> --master --default
+  radosgw-admin zone create --rgw-zonegroup=<zonegroup-name> --rgw-zone=<zone-name> --master
 
 .. prompt:: bash #
 
index 97624fcac62f540e9967a51a98a3f38a8c502b59..7e4d814e95d50fada50010f2b2bbf84b8917efd5 100644 (file)
@@ -85,8 +85,6 @@ Following is an example of zone spec file:
 
 .. code-block:: yaml
 
-  rgw_realm: myrealm
-  rgw_zonegroup: myzonegroup
   rgw_zone: my-secondary-zone
   rgw_realm_token: <token>
   placement:
@@ -124,7 +122,7 @@ List the tokens of all the available realms
 
   ceph rgw zone create -i spec.yaml
 
-Create a new zone and join existing realm (using the realm token)
+Join an existing realm by creating a new secondary zone (using the realm token)
 
 ::
 
index e47b9b5a83b613a720cd8bc8c721c5259ca5765b..b6ff1bbaae8142f1279525202645a822c5051bc5 100644 (file)
@@ -236,7 +236,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
                              placement: Optional[str] = None,
                              start_radosgw: Optional[bool] = True,
                              inbuf: Optional[str] = None):
-        """Bootstrap new rgw zone that syncs with existing zone"""
+        """Bootstrap new rgw zone that syncs with zone on another cluster in the same realm"""
 
         if inbuf:
             rgw_specs = self._parse_rgw_specs(inbuf)
index 68f149aae7a97588e43c40cbe1080bfe9579513a..5f31b38694b04d7c506f0302dbc9f1b4fa8042ba 100644 (file)
@@ -934,6 +934,11 @@ class RGWSpec(ServiceSpec):
         if self.rgw_zone and not self.rgw_realm:
             raise SpecValidationError(
                     'Cannot add RGW: Zone specified but no realm specified')
+        if not (self.rgw_realm and not self.rgw_zonegroup):
+            if self.rgw_realm_token and not self.rgw_zone:
+                raise SpecValidationError('Cannot add RGW: Token specified but no zone specified')
+            elif self.rgw_zone and not self.rgw_realm_token:
+                raise SpecValidationError('Cannot add RGW: Zone specified but no token specified')
 
 
 yaml.add_representer(RGWSpec, ServiceSpec.yaml_representer)
index 0f207b331be8ad33573de2bbeaa4b38cde4e6651..8f1be630a3b806ecb3d23dcac848b1dc62efba70 100644 (file)
@@ -210,7 +210,7 @@ class RealmOp:
         params = ['realm', 'create']
         return RGWAdminJSONCmd(ze).run(params)
 
-    def pull(self, realm, url, access_key, secret, set_default=False):
+    def pull(self, realm, url, access_key, secret):
         params = ['realm',
                   'pull',
                   '--url', url,
@@ -637,7 +637,7 @@ class RGWAM:
         try:
             user_info = self.user_op().info(master_zone, master_zg, access_key=access_key)
         except RGWAMException as e:
-            raise RGWAMException('failed to create system user', e)
+            raise RGWAMException('failed to get the system user information', e)
 
         user = RGWUser(user_info)
 
@@ -754,8 +754,7 @@ class RGWAM:
         secret = realm_token.secret
         try:
             realm_info = self.realm_op().pull(EntityName(realm_token.realm_name),
-                                              realm_token.endpoint, access_key,
-                                              secret, set_default=True)
+                                              realm_token.endpoint, access_key, secret)
         except RGWAMException as e:
             raise RGWAMException('failed to pull realm', e)