From: John Mulligan Date: Mon, 9 Mar 2026 21:14:50 +0000 (-0400) Subject: mgr/cephadm: add custom choose_next_action to ingress service X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=876a366ffa9e09d6a79d1675be7cc44553a83487;p=ceph.git mgr/cephadm: add custom choose_next_action to ingress service The haproxy component of the ingress service performs additional checks to determine in the service needs to be redployed in the case it is fronting nfs and the placement has changed. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/cephadm/services/ingress.py b/src/pybind/mgr/cephadm/services/ingress.py index e4bd677b304c..3d98933d814d 100644 --- a/src/pybind/mgr/cephadm/services/ingress.py +++ b/src/pybind/mgr/cephadm/services/ingress.py @@ -548,3 +548,38 @@ class IngressService(CephService): logger.debug(f'Placement has changed for {spec.service_name()} from {hosts} -> {current_hosts}') return True return False + + 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. + """ + action = super().choose_next_action( + scheduled_action, daemon_type, spec, curr_deps, last_deps + ) + if ( + action is not utils.Action.REDEPLOY + and daemon_type == 'haproxy' + and spec + and hasattr(spec, 'backend_service') + ): + backend_spec = self.mgr.spec_store[spec.backend_service].spec + if ( + backend_spec.service_type == 'nfs' + and self.has_placement_changed(last_deps, spec) + ): + logger.debug( + 'Redeploy wanted %s: placement has changed', + spec.service_name(), + ) + action = utils.Action.REDEPLOY + return action