]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add get_deployment_init_containers
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 14 Jun 2023 16:02:10 +0000 (12:02 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 9 Aug 2023 17:48:07 +0000 (13:48 -0400)
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>
src/cephadm/cephadm.py

index 441fe4866a1d502e1c242d68fdd668aad10b545a..f2ec2a8816822d423f180ee3afc5ef7f8e7e0635 100755 (executable)
@@ -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: