From d9f9a69ab2cb7197e309dbbe0947d0800703fb2c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Feb 2020 09:28:42 -0600 Subject: [PATCH] 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 --- src/pybind/mgr/cephadm/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 1feb7911545..5952165c30f 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 -- 2.47.3