mirror of
https://github.com/ceph/ceph
synced 2024-12-28 14:34:13 +00:00
mgr/cephadm: try to avoid pull when getting container image info
Fixes: https://tracker.ceph.com/issues/58051 Signed-off-by: Mykola Golub <mykola.golub@clyso.com>
This commit is contained in:
parent
ad3f576dde
commit
ac882006e8
@ -1528,12 +1528,21 @@ class CephadmServe:
|
||||
if self.mgr.cache.host_needs_registry_login(host) and self.mgr.registry_url:
|
||||
await 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 = None
|
||||
try:
|
||||
j = await self._run_cephadm_json(host, '', 'inspect-image', [],
|
||||
image=image_name, no_fsid=True,
|
||||
error_ok=True)
|
||||
except OrchestratorError:
|
||||
pass
|
||||
|
||||
j = await self._run_cephadm_json(host, '', 'pull', pullargs, image=image_name, no_fsid=True)
|
||||
if not j:
|
||||
pullargs: List[str] = []
|
||||
if self.mgr.registry_insecure:
|
||||
pullargs.append("--insecure")
|
||||
|
||||
j = await self._run_cephadm_json(host, '', 'pull', pullargs,
|
||||
image=image_name, no_fsid=True)
|
||||
r = ContainerInspectInfo(
|
||||
j['image_id'],
|
||||
j.get('ceph_version'),
|
||||
|
Loading…
Reference in New Issue
Block a user