diff --git a/builder/scaleway/builder_acc_test.go b/builder/scaleway/builder_acc_test.go index dcb6bbb..94bf80a 100644 --- a/builder/scaleway/builder_acc_test.go +++ b/builder/scaleway/builder_acc_test.go @@ -44,6 +44,7 @@ source "scaleway" "basic" { image_name = "Acceptance test" ssh_username = "root" zone = "fr-par-1" + remove_volume = true } build { diff --git a/builder/scaleway/step_create_server.go b/builder/scaleway/step_create_server.go index d21221b..dea2baa 100644 --- a/builder/scaleway/step_create_server.go +++ b/builder/scaleway/step_create_server.go @@ -126,8 +126,6 @@ func (s *stepCreateServer) Run(ctx context.Context, state multistep.StateBag) mu } func (s *stepCreateServer) Cleanup(state multistep.StateBag) { - volumeID := state.Get("root_volume_id").(string) - if s.serverID == "" { return } @@ -150,15 +148,4 @@ func (s *stepCreateServer) Cleanup(state multistep.StateBag) { "Error destroying server. Please destroy it manually: %s", err)) } } - - ui.Say("Removing volume ...") - - err = instanceAPI.DeleteVolume(&instance.DeleteVolumeRequest{ - VolumeID: volumeID, - }) - if err != nil { - err := fmt.Errorf("error removing volume: %s", err) - state.Put("error", err) - ui.Error(fmt.Sprintf("Error removing volume: %s. Please destroy it manually", err)) - } }