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 <jmulligan@redhat.com>
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: