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>
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