]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: upgrade: fix handling when target container id changes 33487/head
authorSage Weil <sage@redhat.com>
Mon, 24 Feb 2020 15:28:42 +0000 (09:28 -0600)
committerSage Weil <sage@redhat.com>
Mon, 24 Feb 2020 15:47:25 +0000 (09:47 -0600)
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 <sage@redhat.com>
src/pybind/mgr/cephadm/module.py

index 1feb79115450816cec46952e0650c79dc00f5e21..5952165c30f8172584031c4b19878bfd454b4a63 100644 (file)
@@ -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