From: Sage Weil Date: Mon, 24 Feb 2020 15:28:42 +0000 (-0600) Subject: mgr/cephadm: upgrade: fix handling when target container id changes X-Git-Tag: v15.1.1~280^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9f9a69ab2cb7197e309dbbe0947d0800703fb2c;p=ceph.git mgr/cephadm: upgrade: fix handling when target container id changes If the same target_name pulls a new hash partway through the upgrade (e.g., because the tag was updated in the registry), we restart the upgrade. Fix the code so that we update target_id instead of (unused) image_id. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 1feb79115450..5952165c30f8 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -700,7 +700,7 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin): r = json.loads(''.join(out)) if r.get('image_id') != target_id: self.log.info('Upgrade: image %s pull on %s got new image %s (not %s), restarting' % (target_name, d.hostname, r['image_id'], target_id)) - self.upgrade_state['image_id'] = r['image_id'] + self.upgrade_state['target_id'] = r['image_id'] self._save_upgrade_state() return None