]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: try to avoid pull when getting container image info
authorMykola Golub <mykola.golub@clyso.com>
Sun, 20 Nov 2022 13:11:11 +0000 (13:11 +0000)
committerAdam King <adking@redhat.com>
Mon, 13 Mar 2023 22:02:08 +0000 (18:02 -0400)
Fixes: https://tracker.ceph.com/issues/58051
Signed-off-by: Mykola Golub <mykola.golub@clyso.com>
(cherry picked from commit ac882006e8bca484ad5dfe93e7374ffec07ef919)

Conflicts:
src/pybind/mgr/cephadm/serve.py

src/pybind/mgr/cephadm/serve.py

index be9f7cd650c09508d8d0e28caa4a3f55c60bec17..c9ba456c60f720b312f1523167f3e702aa64f33a 100644 (file)
@@ -1383,11 +1383,19 @@ class CephadmServe:
             self._registry_login(host,
                                  json.loads(str(self.mgr.get_store('registry_credentials'))))
 
-        pullargs: List[str] = []
-        if self.mgr.registry_insecure:
-            pullargs.append("--insecure")
-
-        j = self._run_cephadm_json(host, '', 'pull', pullargs, image=image_name, no_fsid=True)
+        j = None
+        try:
+            j = self._run_cephadm_json(host, '', 'inspect-image', [],
+                                             image=image_name, no_fsid=True,
+                                             error_ok=True)
+        except OrchestratorError:
+            pass
+
+        if not j:
+            pullargs: List[str] = []
+            if self.mgr.registry_insecure:
+                pullargs.append("--insecure")
+            j = self._run_cephadm_json(host, '', 'pull', pullargs, image=image_name, no_fsid=True)
 
         r = ContainerInspectInfo(
             j['image_id'],