mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-29 03:04:02 -04:00
fix: delete volume only after snapshot step
Signed-off-by: Alexandre NICOLAIE <[email protected]>
This commit is contained in:
@@ -18,6 +18,12 @@ func (s *stepRemoveVolume) Run(ctx context.Context, state multistep.StateBag) mu
|
||||
}
|
||||
|
||||
func (s *stepRemoveVolume) Cleanup(state multistep.StateBag) {
|
||||
if _, ok := state.GetOk("snapshot_name"); !ok {
|
||||
// volume will be detached to server only after sharpshooting ... so we don't
|
||||
// need to remove volume before snapshot step.
|
||||
return
|
||||
}
|
||||
|
||||
client := state.Get("client").(*api.ScalewayAPI)
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
c := state.Get("config").(*Config)
|
||||
|
||||
Reference in New Issue
Block a user