From 78eb5d2c1f1ac5249d21e8a4fa5c91f1e6e86f1c Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 14 Jun 2023 12:02:10 -0400 Subject: [PATCH] cephadm: add get_deployment_init_containers Add get_deployment_init_containers to extract any init containers from the deploy configuration context. Currently, all init containers are to be explicitly defined, not inferred from the service type. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 441fe4866a1..f2ec2a88168 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -6744,6 +6744,17 @@ def get_deployment_container(ctx: CephadmContext, return c +def get_deployment_init_containers( + ctx: CephadmContext, + primary_container: 'CephContainer', +) -> List['InitContainer']: + init_containers: List[Dict[str, Any]] = getattr(ctx, 'init_containers', []) + return [ + InitContainer.from_primary_and_opts(ctx, primary_container, ic_opts) + for ic_opts in init_containers + ] + + def get_deployment_type(ctx: CephadmContext, daemon_type: str, daemon_id: str) -> DeploymentType: deployment_type: DeploymentType = DeploymentType.DEFAULT if ctx.reconfig: -- 2.39.5