From ad46f1c7f1466801f832e9e9567565305671ab8b Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 7 Nov 2023 17:57:43 -0500 Subject: [PATCH] cephadm: update additional container daemon form base class methods Fix the function signature for the previously added stub customize_container_args. Add methods for customize_process_args and customize_container_envs. The "process args" are args passed to the daemon process / entrypoint. Container args are passed to the container engine. Add a default_entrypoint method to return the default entrypoint for a particular daemon-in-container. Signed-off-by: John Mulligan --- .../cephadmlib/container_daemon_form.py | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/cephadm/cephadmlib/container_daemon_form.py b/src/cephadm/cephadmlib/container_daemon_form.py index 4da0624698b..ae8b6afe3c6 100644 --- a/src/cephadm/cephadmlib/container_daemon_form.py +++ b/src/cephadm/cephadmlib/container_daemon_form.py @@ -55,13 +55,33 @@ class ContainerDaemonForm(DaemonForm): """ pass - def customize_container_args(self, args: List[str]) -> None: + def customize_container_args( + self, ctx: CephadmContext, args: List[str] + ) -> None: """Given a list of container arguments this function can update, delete, or otherwise mutate the arguments that the container engine will use. """ pass + def customize_process_args( + self, ctx: CephadmContext, args: List[str] + ) -> None: + """Given a list of arguments for the containerized process, this + function can update, delete, or otherwise mutate the arguments that the + process will use. + """ + pass + + def customize_container_envs( + self, ctx: CephadmContext, envs: List[str] + ) -> None: + """Given a list of environment vars this function can update, delete, + or otherwise mutate the environment variables that are passed by the + container engine to the processes it executes. + """ + pass + def customize_container_endpoints( self, endpoints: List[EndPoint], deployment_type: DeploymentType ) -> None: @@ -84,3 +104,9 @@ class ContainerDaemonForm(DaemonForm): expected to understand this. """ return None + + def default_entrypoint(self) -> str: + """Return the default entrypoint value when running a deamon process + in a container. + """ + return '' -- 2.39.5