From b200e05966d42a4645a991945580efdd35f7e370 Mon Sep 17 00:00:00 2001 From: Thiery Ouattara Date: Wed, 12 Jun 2024 09:44:48 +0000 Subject: [PATCH] Rename volume link resource --- outscale/data_source_outscale_volumes_test.go | 6 +++--- outscale/provider.go | 2 +- ...e_volumes_link.go => resource_outscale_volume_link.go} | 0 ...link_test.go => resource_outscale_volume_link_test.go} | 8 ++++---- .../step1.volumes_datasource_attributes_ok4.ref | 4 ++-- .../step1.volumes_datasource_attributes_ok4.tf | 4 ++-- .../step2.volumes_datasource_attributes_ok4.ref | 4 ++-- .../step2.volumes_datasource_attributes_ok4.tf | 2 +- .../step1.volumes_link_resource_attributes_ok.ref | 4 ++-- .../step1.volumes_link_resource_attributes_ok.tf | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) rename outscale/{resource_outscale_volumes_link.go => resource_outscale_volume_link.go} (100%) rename outscale/{resource_outscale_volumes_link_test.go => resource_outscale_volume_link_test.go} (94%) diff --git a/outscale/data_source_outscale_volumes_test.go b/outscale/data_source_outscale_volumes_test.go index 7806ce8e5..03ad0da1f 100644 --- a/outscale/data_source_outscale_volumes_test.go +++ b/outscale/data_source_outscale_volumes_test.go @@ -164,19 +164,19 @@ func testAccCheckOutscaleVolumesDataSourceConfigWithVM(region, imageID, keypair vm_type = "tinav4.c2r2p2" } - resource "outscale_volumes_link" "outscale_volumes_link" { + resource "outscale_volume_link" "outscale_volume_link" { device_name = "/dev/xvdc" volume_id = outscale_volume.outscale_volume.id vm_id = outscale_vm.outscale_vm.id } - resource "outscale_volumes_link" "outscale_volumes_link_2" { + resource "outscale_volume_link" "outscale_volume_link_2" { device_name = "/dev/xvdd" volume_id = outscale_volume.outscale_volume2.id vm_id = outscale_vm.outscale_vm.id } - resource "outscale_volumes_link" "outscale_volumes_link_3" { + resource "outscale_volume_link" "outscale_volume_link_3" { device_name = "/dev/xvde" volume_id = outscale_volume.outscale_volume3.id vm_id = outscale_vm.outscale_vm.id diff --git a/outscale/provider.go b/outscale/provider.go index fe577b12e..8e8757a2a 100644 --- a/outscale/provider.go +++ b/outscale/provider.go @@ -65,7 +65,7 @@ func Provider() *schema.Provider { "outscale_public_ip": ResourceOutscalePublicIP(), "outscale_public_ip_link": ResourceOutscalePublicIPLink(), "outscale_volume": ResourceOutscaleVolume(), - "outscale_volumes_link": ResourceOutscaleVolumeLink(), + "outscale_volume_link": ResourceOutscaleVolumeLink(), "outscale_net_attributes": ResourceOutscaleLinAttributes(), "outscale_nat_service": ResourceOutscaleNatService(), "outscale_subnet": ResourceOutscaleSubNet(), diff --git a/outscale/resource_outscale_volumes_link.go b/outscale/resource_outscale_volume_link.go similarity index 100% rename from outscale/resource_outscale_volumes_link.go rename to outscale/resource_outscale_volume_link.go diff --git a/outscale/resource_outscale_volumes_link_test.go b/outscale/resource_outscale_volume_link_test.go similarity index 94% rename from outscale/resource_outscale_volumes_link_test.go rename to outscale/resource_outscale_volume_link_test.go index 1714944e5..fa6d9ede3 100644 --- a/outscale/resource_outscale_volumes_link_test.go +++ b/outscale/resource_outscale_volume_link_test.go @@ -32,10 +32,10 @@ func TestAccVM_WithVolumeAttachment_basic(t *testing.T) { Config: testAccOAPIVolumeAttachmentConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( - "outscale_volumes_link.ebs_att", "device_name", "/dev/sdh"), + "outscale_volume_link.ebs_att", "device_name", "/dev/sdh"), testAccCheckOutscaleVMExists("outscale_vm.web", &i), testAccCheckOAPIVolumeAttachmentExists( - "outscale_volumes_link.ebs_att", &i, &v), + "outscale_volume_link.ebs_att", &i, &v), ), }, }, @@ -46,7 +46,7 @@ func TestAccVM_ImportVolumeAttachment_Basic(t *testing.T) { omi := os.Getenv("OUTSCALE_IMAGEID") keypair := os.Getenv("OUTSCALE_KEYPAIR") - resourceName := "outscale_volumes_link.ebs_att" + resourceName := "outscale_volume_link.ebs_att" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckValues(t) }, @@ -130,7 +130,7 @@ func testAccOAPIVolumeAttachmentConfig(omi, vmType, region, keypair string) stri size = 100 } - resource "outscale_volumes_link" "ebs_att" { + resource "outscale_volume_link" "ebs_att" { device_name = "/dev/sdh" volume_id = outscale_volume.volume.id vm_id = outscale_vm.web.id diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref index c98fa78c0..cda8737fa 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref @@ -320,8 +320,8 @@ }, { "mode": "managed", - "type": "outscale_volumes_link", - "name": "outscale_volumes_link", + "type": "outscale_volume_link", + "name": "outscale_volume_link", "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", "instances": [ { diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.tf b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.tf index 1f3fd74e7..1e5d50684 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.tf +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.tf @@ -26,7 +26,7 @@ resource "outscale_vm" "outscale_vm" { security_group_ids = [outscale_security_group.security_group_TF159.security_group_id] } -resource "outscale_volumes_link" "outscale_volumes_link" { +resource "outscale_volume_link" "outscale_volume_link" { device_name = "/dev/xvdc" volume_id = outscale_volume.outscale_volume3.id vm_id = outscale_vm.outscale_vm.id @@ -56,5 +56,5 @@ data "outscale_volumes" "outscale_volumes" { name = "volume_ids" values = [outscale_volume.outscale_volume.volume_id, outscale_volume.outscale_volume2.volume_id, outscale_volume.outscale_volume3.volume_id] } -depends_on = [outscale_volumes_link.outscale_volumes_link] +depends_on = [outscale_volume_link.outscale_volume_link] } diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref index 0d4fc2178..296c778a1 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref @@ -345,8 +345,8 @@ }, { "mode": "managed", - "type": "outscale_volumes_link", - "name": "outscale_volumes_link", + "type": "outscale_volume_link", + "name": "outscale_volume_link", "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", "instances": [ { diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.tf b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.tf index 9184fd0f8..663011987 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.tf +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.tf @@ -25,7 +25,7 @@ resource "outscale_vm" "outscale_vm" { security_group_ids = [outscale_security_group.security_group_TF159.security_group_id] } -resource "outscale_volumes_link" "outscale_volumes_link" { +resource "outscale_volume_link" "outscale_volume_link" { device_name = "/dev/xvdc" volume_id = outscale_volume.outscale_volume3.id vm_id = outscale_vm.outscale_vm.id diff --git a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref index 7fa5e24a9..841a885fa 100644 --- a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref @@ -175,8 +175,8 @@ }, { "mode": "managed", - "type": "outscale_volumes_link", - "name": "outscale_volumes_link", + "type": "outscale_volume_link", + "name": "outscale_volume_link", "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", "instances": [ { diff --git a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.tf b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.tf index 08880e6df..737c508c3 100644 --- a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.tf +++ b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.tf @@ -29,7 +29,7 @@ resource "outscale_vm" "outscale_vm" { security_group_ids = [outscale_security_group.security_group_TF160.security_group_id] } -resource "outscale_volumes_link" "outscale_volumes_link" { +resource "outscale_volume_link" "outscale_volume_link" { device_name = "/dev/xvdc" volume_id = outscale_volume.outscale_volume.id vm_id = outscale_vm.outscale_vm.id