From deaff0c42cb362b21a03dc76cff551741c761561 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 16 Jul 2021 15:29:15 -0400 Subject: [PATCH] mgr/cephadm: use new CEPH_IMAGE_TYPES for all daemons using ceph container image We were using CEPH_TYPES + GATEWAY_TYPES, but that isn't really accurate. Signed-off-by: Sage Weil --- src/pybind/mgr/cephadm/module.py | 11 +++++------ src/pybind/mgr/cephadm/utils.py | 3 +++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 31bab4a51aa..7789fa8346e 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -59,7 +59,7 @@ from .schedule import HostAssignment from .inventory import Inventory, SpecStore, HostCache, EventStore, ClientKeyringStore, ClientKeyringSpec from .upgrade import CephadmUpgrade from .template import TemplateMgr -from .utils import CEPH_TYPES, GATEWAY_TYPES, forall_hosts, cephadmNoImage +from .utils import CEPH_IMAGE_TYPES, forall_hosts, cephadmNoImage from .configchecks import CephadmConfigChecks try: @@ -1346,8 +1346,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, def _get_container_image(self, daemon_name: str) -> Optional[str]: daemon_type = daemon_name.split('.', 1)[0] # type: ignore image: Optional[str] = None - if daemon_type in CEPH_TYPES or \ - daemon_type in GATEWAY_TYPES: + if daemon_type in CEPH_IMAGE_TYPES: # get container image image = str(self.get_foreign_ceph_option( utils.name_to_config_section(daemon_name), @@ -1891,10 +1890,10 @@ Then run the following: if action != 'redeploy': raise OrchestratorError( f'Cannot execute {action} with new image. `action` needs to be `redeploy`') - if daemon_type not in CEPH_TYPES and daemon_type not in GATEWAY_TYPES: + if daemon_type not in CEPH_IMAGE_TYPES: raise OrchestratorError( f'Cannot redeploy {daemon_type}.{daemon_id} with a new image: Supported ' - f'types are: {", ".join(CEPH_TYPES + GATEWAY_TYPES)}') + f'types are: {", ".join(CEPH_IMAGE_TYPES)}') self.check_mon_command({ 'prefix': 'config set', @@ -2495,7 +2494,7 @@ Then run the following: for name, dd in dm.items(): if image_info.image_id == dd.container_image_id: r['up_to_date'].append(dd.name()) - elif dd.daemon_type in (CEPH_TYPES + GATEWAY_TYPES): + elif dd.daemon_type in CEPH_IMAGE_TYPES: r['needs_update'][dd.name()] = { 'current_name': dd.container_image_name, 'current_id': dd.container_image_id, diff --git a/src/pybind/mgr/cephadm/utils.py b/src/pybind/mgr/cephadm/utils.py index be7ef49ba9f..99e1683ed03 100644 --- a/src/pybind/mgr/cephadm/utils.py +++ b/src/pybind/mgr/cephadm/utils.py @@ -24,8 +24,11 @@ class CephadmNoImage(Enum): CEPH_TYPES = ['mgr', 'mon', 'crash', 'osd', 'mds', 'rgw', 'rbd-mirror', 'cephfs-mirror'] GATEWAY_TYPES = ['iscsi', 'nfs'] MONITORING_STACK_TYPES = ['node-exporter', 'prometheus', 'alertmanager', 'grafana'] + CEPH_UPGRADE_ORDER = CEPH_TYPES + GATEWAY_TYPES + MONITORING_STACK_TYPES +# these daemon types use the ceph container image +CEPH_IMAGE_TYPES = CEPH_TYPES + ['iscsi', 'nfs'] # Used for _run_cephadm used for check-host etc that don't require an --image parameter cephadmNoImage = CephadmNoImage.token -- 2.39.5