mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-20 11:21:49 +00:00
142ca6eec3
DeleteSnapshot checked only volume documents, so a snapshot backing a registered AMI deleted anyway and left the AMI pointing at nothing. Add a strict, whole-cluster AMI read next to the existing volume-clone check and refuse with InvalidSnapshot.InUse when a registered AMI names the snapshot; an unreadable or undecodable AMI document fails the delete closed with ServerInternal. The e2e teardown sweep now deregisters images before deleting snapshots, since a snapshot sweep that runs first would now be blocked by its AMI. Known residual, out of scope here: RegisterImage reading the snapshot and DeleteSnapshot's clone/AMI checks are not atomic, so a concurrent RegisterImage can still race a DeleteSnapshot that passed its checks.