]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add custom choose_next_action to jaeger agent service
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 9 Mar 2026 20:04:06 +0000 (16:04 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 26 Mar 2026 13:31:39 +0000 (09:31 -0400)
The jaeger agent service must always be redeployed instead of
reconfigured when the dependencies have changed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/cephadm/services/jaeger.py

index cde78769aa7cd45d2555674f4be1abd40932e0c3..c8bb3565db8be7d8f3dafaa5b295df43853a36c8 100644 (file)
@@ -3,6 +3,7 @@ from cephadm.services.cephadmservice import CephadmService, CephadmDaemonDeployS
 from ceph.deployment.service_spec import TracingSpec, ServiceSpec
 from .service_registry import register_cephadm_service
 from mgr_util import build_url
+from cephadm import utils
 
 if TYPE_CHECKING:
     from ..module import CephadmOrchestrator
@@ -49,6 +50,30 @@ class JaegerAgentService(CephadmService):
         daemon_spec.deps = self.get_dependencies(self.mgr)
         return daemon_spec
 
+    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
+        )
+        # changes to jaeger-agent deps affect the way the unit.run for
+        # the daemon is written, which we rewrite on redeploy, but not
+        # on reconfig.
+        if action is utils.Action.RECONFIG:
+            action = utils.Action.REDEPLOY
+        return action
+
 
 @register_cephadm_service
 class JaegerCollectorService(CephadmService):