]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: call `podman rm --storage`
authorSebastian Wagner <sebastian.wagner@suse.com>
Wed, 10 Jun 2020 12:20:20 +0000 (14:20 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 14 Jul 2020 09:39:06 +0000 (11:39 +0200)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit decfbca835ae0a2f03ae169f79fafa1d0babbbcb)

src/cephadm/cephadm

index 3e0603fbfc26445fa1281d17ae9a5a0f1b32d419..5bd28fc24d0b3a5451fd37e885f0f2d867bd4e8f 100755 (executable)
@@ -1887,6 +1887,9 @@ def deploy_daemon_units(fsid, uid, gid, daemon_type, daemon_id, c,
 
         # Sometimes, adding `--rm` to a run_cmd doesn't work. Let's remove the container manually
         f.write(' '.join(c.rm_cmd()) + '\n')
+        # Sometimes, `podman rm` doesn't find the container. Then you'll have to add `--storage`
+        if 'podman' in container_path:
+            f.write(' '.join(c.rm_cmd(storage=True)) + '\n')
 
         # container run command
         f.write(' '.join(c.run_cmd()) + '\n')
@@ -2212,13 +2215,16 @@ class CephContainer:
             self.cname,
         ] + cmd
 
-    def rm_cmd(self):
-        # type: () -> List[str]
-        return [
+    def rm_cmd(self, storage=False):
+        # type: (bool) -> List[str]
+        ret = [
             str(container_path),
             'rm', '-f',
-            self.cname
         ]
+        if storage:
+            ret.append('--storage')
+        ret.append(self.cname)
+        return ret
 
     def run(self, timeout=DEFAULT_TIMEOUT):
         # type: (Optional[int]) -> str