]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add custom choose_next_action to ingress service
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 9 Mar 2026 21:14:50 +0000 (17:14 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 26 Mar 2026 13:31:39 +0000 (09:31 -0400)
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 <jmulligan@redhat.com>
src/pybind/mgr/cephadm/services/ingress.py

index e4bd677b304c0eea20428d2c2b668f9f1658a868..3d98933d814d26afe04a52daaa7a216ec1ab4615 100644 (file)
@@ -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