From 9bb96319543201390b17c82e50dfc9872119fc29 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Tue, 28 Feb 2023 19:27:39 +0200 Subject: [PATCH] mgr/cephadm: try to avoid pull when getting container image info only if use_repo_digest is not set. The commit ac88200 introduced this possibility to skip pulling, but doing this unconditionally broke a use case when one was able to have a ceph image on a floating tag, and was able to upgrade to a new image pushed to that tag. As using a floating tag is possible only when use_repo_digest is enabled (the default), now skipping the pull if use_repo_digest is disabled will not break it anymore. Signed-off-by: Mykola Golub (cherry picked from commit 4d049880a0effa78b69179694430d8a274829342) --- src/pybind/mgr/cephadm/serve.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index 1864c9c592ff..a7302f5687ce 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -1461,12 +1461,13 @@ class CephadmServe: await self._registry_login(host, json.loads(str(self.mgr.get_store('registry_credentials')))) j = None - try: - j = await self._run_cephadm_json(host, '', 'inspect-image', [], - image=image_name, no_fsid=True, - error_ok=True) - except OrchestratorError: - pass + if not self.mgr.use_repo_digest: + try: + j = await 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] = [] -- 2.47.3