]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: Don't allow stopping full mgr, mon or osd services
authorAdam King <adking@redhat.com>
Fri, 23 Jul 2021 14:01:54 +0000 (10:01 -0400)
committerAdam King <adking@redhat.com>
Fri, 23 Jul 2021 21:04:35 +0000 (17:04 -0400)
I can't think of any case where we would want to allow this

Fixes: https://tracker.ceph.com/issues/51298
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/module.py

index 44f036536baca27ab8a3735941f71e445daee87d..31bab4a51aa42ff06b4f4bbd82802caa76e9259b 100644 (file)
@@ -1842,6 +1842,8 @@ Then run the following:
         if not dds:
             raise OrchestratorError(f'No daemons exist under service name "{service_name}".'
                                     + ' View currently running services using "ceph orch ls"')
+        if action == 'stop' and service_name.split('.')[0].lower() in ['mgr', 'mon', 'osd']:
+            return [f'Stopping entire {service_name} service is prohibited.']
         self.log.info('%s service %s' % (action.capitalize(), service_name))
         return [
             self._schedule_daemon_action(dd.name(), action)