]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Addressing reviewers comments
authorRedouane Kachach <rkachach@redhat.com>
Tue, 11 Jul 2023 08:01:39 +0000 (10:01 +0200)
committerAdam King <adking@redhat.com>
Thu, 31 Aug 2023 17:36:14 +0000 (13:36 -0400)
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 5a043fe6d25fd986a5ccb55b4920922c1fcd0f22)

src/cephadm/cephadm.py
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/services/nvmeof.py

index 268710f965c30c933a56676731790cb358d51bee..433979893976c8bc8124db1f5a18a6278c944125 100755 (executable)
@@ -1041,10 +1041,10 @@ class CephNvmeof(object):
 
     @staticmethod
     def get_version(ctx: CephadmContext, container_id: str) -> Optional[str]:
-        out, err, ret = call_throws(ctx, [
-            ctx.container_engine.path, 'inspect',
-            '--format', '{{index .Config.Labels "io.ceph.version"}}',
-            ctx.image])
+        out, err, ret = call(ctx,
+                             [ctx.container_engine.path, 'inspect',
+                              '--format', '{{index .Config.Labels "io.ceph.version"}}',
+                              ctx.image])
         version = None
         if ret == 0:
             version = out.strip()
@@ -4110,7 +4110,7 @@ def install_sysctl(ctx: CephadmContext, fsid: str, daemon_type: str) -> None:
         lines = HAproxy.get_sysctl_settings()
     elif daemon_type == 'keepalived':
         lines = Keepalived.get_sysctl_settings()
-    elif daemon_type == 'nvmeof':
+    elif daemon_type == CephNvmeof.daemon_type:
         lines = CephNvmeof.get_sysctl_settings()
     lines = filter_sysctl_settings(ctx, lines)
 
index 47f2f2fc8f5639a87c8a3bbc9f49a1f5368da058..1b1d56d9609e8a48b07b5731b71aa7634ea0cbae 100644 (file)
@@ -2284,7 +2284,7 @@ Then run the following:
 
         if action == 'rotate-key':
             if d.daemon_type not in ['mgr', 'osd', 'mds',
-                                     'rgw', 'crash', 'nfs', 'rbd-mirror', 'iscsi', 'nvmeof']:
+                                     'rgw', 'crash', 'nfs', 'rbd-mirror', 'iscsi']:
                 raise OrchestratorError(
                     f'key rotation not supported for {d.daemon_type}'
                 )
@@ -2662,8 +2662,6 @@ Then run the following:
                 deps = [self.iscsi_service.get_trusted_ips(iscsi_spec)]
             else:
                 deps = [self.get_mgr_ip()]
-        elif daemon_type == 'nvmeof':
-            deps = []  # TODO(redo)
         elif daemon_type == 'prometheus':
             # for prometheus we add the active mgr as an explicit dependency,
             # this way we force a redeploy after a mgr failover
index 00db7e556019d519181e953c749eef798fae6b0e..e3b684a225a9388dd3c89da2f5d9f257c6bd8af1 100644 (file)
@@ -1,5 +1,4 @@
 import errno
-import json
 import logging
 from typing import List, cast, Optional
 
@@ -47,7 +46,7 @@ class NvmeofService(CephService):
         daemon_spec.keyring = keyring
         daemon_spec.extra_files = {'ceph-nvmeof.conf': gw_conf}
         daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
-        daemon_spec.deps = []  # TODO: which gw parameters will require a reconfig?
+        daemon_spec.deps = []
         return daemon_spec
 
     def config_dashboard(self, daemon_descrs: List[DaemonDescription]) -> None:
@@ -79,25 +78,8 @@ class NvmeofService(CephService):
         Called after the daemon is removed.
         """
         logger.debug(f'Post remove daemon {self.TYPE}.{daemon.daemon_id}')
-
         # TODO: remove config for dashboard nvmeof gateways if any
-        # needed to know if we have ssl stuff for nvmeof in ceph config
-        nvmeof_config_dict = {}
-        ret, nvmeof_config, err = self.mgr.mon_command({
-            'prefix': 'config-key dump',
-            'key': 'nvmeof',
-        })
-        if nvmeof_config:
-            nvmeof_config_dict = json.loads(nvmeof_config)
-
-        # remove nvmeof cert and key from ceph config
-        for nvmeof_key, value in nvmeof_config_dict.items():
-            if f'nvmeof/client.{daemon.name()}/' in nvmeof_key:
-                ret, out, err = self.mgr.mon_command({
-                    'prefix': 'config-key rm',
-                    'key': nvmeof_key,
-                })
-                logger.info(f'{nvmeof_key} removed from ceph config')
+        # and any certificates being used for mTLS
 
     def purge(self, service_name: str) -> None:
         """Removes configuration