]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: adding the SSL cert as a dependency for rgw service
authorRedouane Kachach <rkachach@ibm.com>
Fri, 7 Feb 2025 10:46:25 +0000 (11:46 +0100)
committerRedouane Kachach <rkachach@ibm.com>
Fri, 7 Feb 2025 12:23:22 +0000 (13:23 +0100)
this way when the user changes the SSL certificate in the spec and
performs an 'orch apply' cephadm will detect the change and
reconfigure the rgw service automatically

Fixes: https://tracker.ceph.com/issues/69863
Signed-off-by: Redouane Kachach <rkachach@ibm.com>
src/pybind/mgr/cephadm/services/cephadmservice.py

index 301b7ca2f414913a0c857e5828337c60075f5892..70354282a18968338ec3a53aece8b2fbb09f5a5d 100644 (file)
@@ -996,6 +996,21 @@ class RgwService(CephService):
     def allow_colo(self) -> bool:
         return True
 
+    @classmethod
+    def get_dependencies(cls, mgr: "CephadmOrchestrator",
+                         spec: Optional[ServiceSpec] = None,
+                         daemon_type: Optional[str] = None) -> List[str]:
+
+        deps = []
+        rgw_spec = cast(RGWSpec, spec)
+        ssl_cert = getattr(rgw_spec, 'rgw_frontend_ssl_certificate', None)
+        if ssl_cert:
+            if isinstance(ssl_cert, list):
+                ssl_cert = '\n'.join(ssl_cert)
+            deps.append(f'ssl-cert:{str(utils.md5_hash(ssl_cert))}')
+
+        return sorted(deps)
+
     def set_realm_zg_zone(self, spec: RGWSpec) -> None:
         assert self.TYPE == spec.service_type