fix(deploy): keep broker credentials active during update rollback
Preserve broker environment and the active keyring mount when rolling application images back. Guard with update staging tests: 54 passed. No runtime services changed.
This commit is contained in:
@@ -390,8 +390,12 @@ def prepare_update(args):
|
||||
if mount['target']=='/run/hainuo-credentials/keyring.json':
|
||||
mount['source']=str(output/'credential-keyring.json')
|
||||
write_json(output/'compose.broker.json',overlay)
|
||||
write_json(output/'compose.rollback.json',{'services':{name:{'image':roles[name]['image']}
|
||||
for name in ('connector','router','longconn','enrollment-signer')}})
|
||||
rollback=json.loads(json.dumps(overlay))
|
||||
for name in ('connector','router'):
|
||||
rollback['services'][name]['image']=roles[name]['image']
|
||||
# An update rollback must retain broker env/key mounts, never silently
|
||||
# revert to the original legacy credential owner from base Compose files.
|
||||
write_json(output/'compose.rollback.json',rollback)
|
||||
payload=output/'build';payload.mkdir(mode=0o700)
|
||||
for path in (source/'relay').rglob('*'):
|
||||
if path.is_symlink():raise DeployError('symlink in update source')
|
||||
|
||||
Reference in New Issue
Block a user