From: John Mulligan Date: Wed, 14 Jun 2023 16:02:10 +0000 (-0400) Subject: cephadm: add get_deployment_init_containers X-Git-Tag: v19.0.0~711^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=78eb5d2c1f1ac5249d21e8a4fa5c91f1e6e86f1c;p=ceph.git 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 --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 441fe4866a1d..f2ec2a881682 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: