mirror of
https://github.com/ceph/ceph
synced 2024-12-21 10:54:42 +00:00
mgr/rook: pass zone attribute to CephObjectStore CR when creating rgw
This commit passes the zone attribute to the CephObjectStore CR when creating a RGW instance using the Rook Orchestrator backend: `ceph orch apply rgw <rgw-name> --realm=<realm-name> --zone=<zone-name>` Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
This commit is contained in:
parent
af622e8cd7
commit
68b13c262c
@ -438,7 +438,6 @@ class RookCluster(object):
|
||||
# translate . to - (fingers crossed!) instead.
|
||||
name = spec.service_id.replace('.', '-')
|
||||
|
||||
# FIXME: pass realm and/or zone through to the CR
|
||||
|
||||
def _create_zone() -> cos.CephObjectStore:
|
||||
port = None
|
||||
@ -447,21 +446,26 @@ class RookCluster(object):
|
||||
secure_port = spec.get_port()
|
||||
else:
|
||||
port = spec.get_port()
|
||||
return cos.CephObjectStore(
|
||||
apiVersion=self.rook_env.api_name,
|
||||
metadata=dict(
|
||||
name=name,
|
||||
namespace=self.rook_env.namespace
|
||||
),
|
||||
spec=cos.Spec(
|
||||
gateway=cos.Gateway(
|
||||
type='s3',
|
||||
port=port,
|
||||
securePort=secure_port,
|
||||
instances=spec.placement.count or 1,
|
||||
object_store = cos.CephObjectStore(
|
||||
apiVersion=self.rook_env.api_name,
|
||||
metadata=dict(
|
||||
name=name,
|
||||
namespace=self.rook_env.namespace
|
||||
),
|
||||
spec=cos.Spec(
|
||||
gateway=cos.Gateway(
|
||||
port=port,
|
||||
securePort=secure_port,
|
||||
instances=spec.placement.count or 1,
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
if spec.rgw_zone:
|
||||
object_store.spec.zone=cos.Zone(
|
||||
name=spec.rgw_zone
|
||||
)
|
||||
return object_store
|
||||
|
||||
|
||||
def _update_zone(new: cos.CephObjectStore) -> cos.CephObjectStore:
|
||||
new.spec.gateway.instances = spec.placement.count or 1
|
||||
|
Loading…
Reference in New Issue
Block a user