]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add an identity field to BasicContainer
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 23 Jun 2023 17:43:47 +0000 (13:43 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 9 Aug 2023 17:48:07 +0000 (13:48 -0400)
Use the new DaemonIdentity class to help identify a container.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index d3b3ba50f1f6bf57815abb4549bf4746eb640363..a4bbd932cc6c2836d8994e0f114a397392e65be5 100755 (executable)
@@ -4472,8 +4472,8 @@ class BasicContainer:
         *,
         image: str,
         entrypoint: str,
+        identity: Optional['DaemonIdentity'],
         args: Optional[List[str]] = None,
-        container_name: str = '',
         container_args: Optional[List[str]] = None,
         envs: Optional[List[str]] = None,
         volume_mounts: Optional[Dict[str, str]] = None,
@@ -4490,8 +4490,8 @@ class BasicContainer:
         self.ctx = ctx
         self.image = image
         self.entrypoint = entrypoint
+        self.identity = identity
         self.args = args or []
-        self.container_name = container_name
         self.container_args = container_args or []
         self.envs = envs or []
         self.volume_mounts = volume_mounts or {}
@@ -4519,7 +4519,8 @@ class BasicContainer:
 
     @property
     def cname(self) -> str:
-        return self.container_name
+        assert self.identity
+        return self.identity.container_name
 
     def build_run_cmd(self) -> List[str]:
         cmd_args: List[str] = [self._container_engine]