From: John Mulligan Date: Mon, 9 Mar 2026 20:03:48 +0000 (-0400) Subject: mgr/cephadm: add custom choose_next_action to nfs service X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c68ae74cee2854203dcc6023660492a90605e1d;p=ceph.git mgr/cephadm: add custom choose_next_action to nfs service The nfs service needs to use the deps difference to detect if any non-kmip related dependencies changed and force a redeploy instead of a reconfig when so. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/cephadm/services/nfs.py b/src/pybind/mgr/cephadm/services/nfs.py index d622e68e4b82..e888876a6666 100644 --- a/src/pybind/mgr/cephadm/services/nfs.py +++ b/src/pybind/mgr/cephadm/services/nfs.py @@ -435,3 +435,34 @@ class NFSService(CephService): if not monitoring_addr: logger.debug(f"No IP address found in the network {spec.monitoring_networks} on host {host}.") return monitoring_addr, monitoring_port + + manages_own_next_action = True + + def choose_next_action( + self, + scheduled_action: utils.Action, + daemon_type: Optional[str], + spec: Optional[ServiceSpec], + curr_deps: List[str], + last_deps: List[str], + ) -> utils.Action: + """Given the scheduled_action, service spec, daemon_type, and + current and previous dependency lists return the next action that + this service would prefer cephadm take. + """ + if curr_deps == last_deps: + return scheduled_action + sym_diff = set(curr_deps).symmetric_difference(last_deps) + logger.info( + 'Reconfigure wanted %s: deps %r -> %r (diff %r)', + spec.service_name() if spec else daemon_type, + last_deps, + curr_deps, + sym_diff, + ) + action = utils.Action.RECONFIG + # check what has changed, based on that decide action + only_kmip_updated = all(s.startswith('kmip') for s in sym_diff) + if not only_kmip_updated: + action = utils.Action.REDEPLOY + return action