Release deployment lock before pruning old production image
This commit is contained in:
@@ -850,7 +850,6 @@ class Deploy:
|
||||
self.state["status"] = "success"
|
||||
self.state_io(self.state)
|
||||
print("DEPLOY VERIFIED", flush=True)
|
||||
self.cleanup_images()
|
||||
except BaseException as exc:
|
||||
print("DEPLOY FAILED:", type(exc).__name__, flush=True)
|
||||
self.diagnostics()
|
||||
@@ -873,6 +872,10 @@ class Deploy:
|
||||
if safe_unlock:
|
||||
self.unlock()
|
||||
|
||||
# The deployment lock itself references the old image. Release it
|
||||
# before retention; other container references remain protected.
|
||||
self.cleanup_images()
|
||||
|
||||
def recover(self, manual=False):
|
||||
self.settings()
|
||||
lock = self.run(
|
||||
|
||||
@@ -137,6 +137,7 @@ def test_deploy_rolls_back_exact_baseline_without_deleting_data(
|
||||
else:
|
||||
tool.deploy()
|
||||
assert cleanup == ["success"]
|
||||
assert "unlock" in calls
|
||||
assert activated == [new]
|
||||
assert saved[-1]["status"] == "success"
|
||||
assert saved[-1]["rollback_tag"] == tool.old_image_tag + "-rollback"
|
||||
|
||||
Reference in New Issue
Block a user