diff --git a/CHANGELOG.md b/CHANGELOG.md index 850b2708c..e6ea16fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.6.1 (Jul 7, 2022) + +BUG FIXES: + +- Fix client type assertion in equinix_metal_reserved_ip_block [#220](https://github.com/equinix/terraform-provider-equinix/pull/220) + ## 1.6.0 (Jul 6, 2022) FEATURES: diff --git a/cmd/migration-tool/version.go b/cmd/migration-tool/version.go index 604fb107b..858312436 100644 --- a/cmd/migration-tool/version.go +++ b/cmd/migration-tool/version.go @@ -1,6 +1,4 @@ package main -var ( - // Version is set at build-time in the release process - Version = "dev" -) +// Version is set at build-time in the release process +var Version = "dev" diff --git a/equinix/data_source_metal_device_acc_test.go b/equinix/data_source_metal_device_acc_test.go index 448457154..3171b9a20 100644 --- a/equinix/data_source_metal_device_acc_test.go +++ b/equinix/data_source_metal_device_acc_test.go @@ -49,7 +49,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" termination_time = "%s" @@ -65,7 +65,7 @@ resource "equinix_metal_device" "test" { data "equinix_metal_device" "test" { project_id = equinix_metal_project.test.id hostname = equinix_metal_device.test.hostname -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, testDeviceTerminationTime()) } func TestAccDataSourceMetalDevice_byID(t *testing.T) { @@ -109,7 +109,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" termination_time = "%s" @@ -124,5 +124,5 @@ resource "equinix_metal_device" "test" { data "equinix_metal_device" "test" { device_id = equinix_metal_device.test.id -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, testDeviceTerminationTime()) } diff --git a/equinix/data_source_metal_ip_block_ranges_acc_test.go b/equinix/data_source_metal_ip_block_ranges_acc_test.go index 7827c0dbc..3471ceb00 100644 --- a/equinix/data_source_metal_ip_block_ranges_acc_test.go +++ b/equinix/data_source_metal_ip_block_ranges_acc_test.go @@ -46,7 +46,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-ip-test" plan = local.plan facilities = local.facilities - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -54,7 +54,7 @@ resource "equinix_metal_device" "test" { lifecycle { ignore_changes = [ plan, - metro, + facilities, ] } } @@ -68,5 +68,5 @@ resource "equinix_metal_ip_attachment" "test" { device_id = equinix_metal_device.test.id cidr_notation = cidrsubnet(data.equinix_metal_ip_block_ranges.test.ipv6.0, 8, 2) } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } diff --git a/equinix/data_source_metal_port_acc_test.go b/equinix/data_source_metal_port_acc_test.go index 13755c399..7be9cdbea 100644 --- a/equinix/data_source_metal_port_acc_test.go +++ b/equinix/data_source_metal_port_acc_test.go @@ -38,7 +38,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device-port" plan = local.plan metro = local.metro - operating_system = "ubuntu_20_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -56,7 +56,7 @@ data "equinix_metal_port" "test" { name = "eth0" } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func TestAccDataSourceMetalPort_byId(t *testing.T) { @@ -89,7 +89,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device-port" plan = local.plan metro = local.metro - operating_system = "ubuntu_20_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -105,5 +105,5 @@ resource "equinix_metal_device" "test" { data "equinix_metal_port" "test" { port_id = equinix_metal_device.test.ports[0].id } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } diff --git a/equinix/data_source_metal_precreated_ip_block_acc_test.go b/equinix/data_source_metal_precreated_ip_block_acc_test.go index 1bb910c4e..ebfcf046d 100644 --- a/equinix/data_source_metal_precreated_ip_block_acc_test.go +++ b/equinix/data_source_metal_precreated_ip_block_acc_test.go @@ -46,7 +46,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device-ip-blockt" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -70,5 +70,5 @@ resource "equinix_metal_ip_attachment" "test" { device_id = equinix_metal_device.test.id cidr_notation = cidrsubnet(data.equinix_metal_precreated_ip_block.test.cidr_notation,8,2) } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } diff --git a/equinix/data_source_metal_spot_market_request_acc_test.go b/equinix/data_source_metal_spot_market_request_acc_test.go index 16a635de2..18280ca57 100644 --- a/equinix/data_source_metal_spot_market_request_acc_test.go +++ b/equinix/data_source_metal_spot_market_request_acc_test.go @@ -50,6 +50,7 @@ func TestAccDataSourceMetalSpotMarketRequest_basic(t *testing.T) { func testAccDataSourceMetalSpotMarketRequestConfig_basic(projSuffix string) string { return fmt.Sprintf(` +%s resource "equinix_metal_project" "test" { name = "tfacc-spot_market_request-%s" @@ -58,7 +59,7 @@ resource "equinix_metal_project" "test" { resource "equinix_metal_spot_market_request" "req" { project_id = "${equinix_metal_project.test.id}" max_bid_price = 0.01 - facilities = ["da11"] + facilities = local.facilities devices_min = 1 devices_max = 1 wait_for_devices = false @@ -66,28 +67,36 @@ resource "equinix_metal_spot_market_request" "req" { instance_parameters { hostname = "tfacc-testspot" billing_cycle = "hourly" - operating_system = "ubuntu_20_04" - plan = "c3.medium.x86" + operating_system = local.os + plan = local.plan + } + + lifecycle { + ignore_changes = [ + instance_parameters, + facilities, + ] } } data "equinix_metal_spot_market_request" "dreq" { request_id = equinix_metal_spot_market_request.req.id } -`, projSuffix) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix) } func testAccDataSourceMetalSpotMarketRequestConfig_metro(projSuffix string) string { return fmt.Sprintf(` +%s resource "equinix_metal_project" "test" { name = "tfacc-spot_market_request-%s" } resource "equinix_metal_spot_market_request" "req" { - project_id = "${equinix_metal_project.test.id}" + project_id = equinix_metal_project.test.id max_bid_price = 0.01 - metro = "da" + metro = local.metro devices_min = 1 devices_max = 1 wait_for_devices = false @@ -95,13 +104,20 @@ resource "equinix_metal_spot_market_request" "req" { instance_parameters { hostname = "tfacc-testspot" billing_cycle = "hourly" - operating_system = "ubuntu_20_04" - plan = "c3.medium.x86" + operating_system = local.os + plan = local.plan + } + + lifecycle { + ignore_changes = [ + instance_parameters, + metro, + ] } } data "equinix_metal_spot_market_request" "dreq" { request_id = equinix_metal_spot_market_request.req.id } -`, projSuffix) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix) } diff --git a/equinix/data_source_network_device.go b/equinix/data_source_network_device.go index 8891d75a3..432e71499 100644 --- a/equinix/data_source_network_device.go +++ b/equinix/data_source_network_device.go @@ -638,6 +638,9 @@ func dataSourceNetworkDeviceRead(ctx context.Context, d *schema.ResourceData, m uuid := uuidIf.(string) validDeviceStatusList, err := getNeDeviceStatusList(d.Get(neDeviceSchemaNames["ValidStatusList"]).(string)) + if err != nil { + return diag.Errorf("cannot get network device status list due to '%v'", err) + } if nameExists { primary, err = getDeviceByName(name, conf, validDeviceStatusList) diff --git a/equinix/resource_metal_bgp_setup_acc_test.go b/equinix/resource_metal_bgp_setup_acc_test.go index 8f2c11745..03dbca0ae 100644 --- a/equinix/resource_metal_bgp_setup_acc_test.go +++ b/equinix/resource_metal_bgp_setup_acc_test.go @@ -82,7 +82,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-bgp-sesh" plan = local.plan facilities = local.facilities - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" termination_time = "%s" @@ -110,5 +110,5 @@ resource "equinix_metal_bgp_session" "test6" { data "equinix_metal_device_bgp_neighbors" "test" { device_id = equinix_metal_bgp_session.test4.device_id } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } diff --git a/equinix/resource_metal_device_acc_test.go b/equinix/resource_metal_device_acc_test.go index a15008b9f..46df8dee0 100644 --- a/equinix/resource_metal_device_acc_test.go +++ b/equinix/resource_metal_device_acc_test.go @@ -15,9 +15,12 @@ import ( "github.com/packethost/packngo" ) -// list of plans and metros used as filter criteria to find available hardware to run tests -var preferable_plans = []string{"x1.small.x86", "t1.small.x86", "c2.medium.x86", "c3.small.x86", "c3.medium.x86", "m3.small.x86"} -var preferable_metros = []string{"ch", "ny", "sv", "ty", "am"} +// list of plans and metros and os used as filter criteria to find available hardware to run tests +var ( + preferable_plans = []string{"x1.small.x86", "t1.small.x86", "c2.medium.x86", "c3.small.x86", "c3.medium.x86", "m3.small.x86"} + preferable_metros = []string{"ch", "ny", "sv", "ty", "am"} + preferable_os = []string{"ubuntu_20_04"} +) func init() { resource.AddTestSweepers("equinix_metal_device", &resource.Sweeper{ @@ -82,7 +85,11 @@ var matchErrShouldNotBeAnIPXE = regexp.MustCompile(`.*"user_data" should not be // facilities, // ] // } -func confAccMetalDevice_base(plans, metros []string) string { +// +// TODO consider adding a datasource for equinix_metal_operating_system and making the local.os conditional +// https://github.com/equinix/terraform-provider-equinix/pull/220#discussion_r915418418equinix_metal_operating_system +// https://github.com/equinix/terraform-provider-equinix/discussions/221 +func confAccMetalDevice_base(plans, metros, os []string) string { return fmt.Sprintf(` data "equinix_metal_plans" "test" { filter { @@ -93,6 +100,10 @@ data "equinix_metal_plans" "test" { attribute = "available_in_metros" values = [%s] } + filter { + attribute = "deployment_types" + values = ["on_demand", "spot_market"] + } } locals { @@ -106,7 +117,15 @@ locals { plan_idx = length(local.plan_idxs) > 0 ? local.plan_idxs[0] : 0 plan = local.plans[local.plan_idx].slug - facilities = tolist(setsubtract(local.plans[local.plan_idx].available_in, ["sjc1", "ld7", "sy4"])) + //Operations to select a facility randomly and avoid race conditions with facilities without capacity. + //With these operations we use current time seconds as the seed, and avoid using a third party provider in the Equinix provider tests + facilities = tolist(setsubtract(local.plans[local.plan_idx].available_in, ["sjc1", "ld7", "sy4", "ny6"])) + facilities_random_num = formatdate("s", timestamp()) + facilities_length = length(local.facilities) + facilities_range_limit = ceil(59 / local.facilities_length) == 1 ? local.facilities_length : 59 + facility_idxs = [for idx, value in range(0, local.facilities_range_limit, ceil(59 / local.facilities_length)) : idx if local.facilities_random_num <= value] + facility_idx = length(local.facility_idxs) > 0 ? local.facility_idxs[0] : 0 + facility = local.facilities[local.facility_idx] //Operations to select a metro randomly and avoid race conditions with metros without capacity. //With these operations we use current time seconds as the seed, and avoid using a third party provider in the Equinix provider tests @@ -117,8 +136,10 @@ locals { metro_idxs = [for idx, value in range(0, local.metros_range_limit, ceil(59 / local.metros_length)) : idx if local.metros_random_num <= value] metro_idx = length(local.metro_idxs) > 0 ? local.metro_idxs[0] : 0 metro = local.metros[local.metro_idx] + + os = [%s][0] } -`, fmt.Sprintf("\"%s\"", strings.Join(plans[:], `","`)), fmt.Sprintf("\"%s\"", strings.Join(metros[:], `","`))) +`, fmt.Sprintf("\"%s\"", strings.Join(plans[:], `","`)), fmt.Sprintf("\"%s\"", strings.Join(metros[:], `","`)), fmt.Sprintf("\"%s\"", strings.Join(os[:], `","`))) } func testDeviceTerminationTime() string { @@ -233,8 +254,6 @@ func TestAccMetalDevice_metro(t *testing.T) { testAccMetalDeviceExists(r, &device), testAccMetalDeviceNetwork(r), testAccMetalDeviceAttributes(&device), - resource.TestCheckResourceAttr( - r, "metro", "sv"), ), }, }, @@ -345,7 +364,7 @@ func TestAccMetalDevice_IPXEConflictingFields(t *testing.T) { CheckDestroy: testAccMetalDeviceCheckDestroyed, Steps: []resource.TestStep{ { - Config: fmt.Sprintf(testAccMetalDeviceConfig_ipxe_conflict, confAccMetalDevice_base(preferable_plans, preferable_metros), rs), + Config: fmt.Sprintf(testAccMetalDeviceConfig_ipxe_conflict, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), rs), Check: resource.ComposeTestCheckFunc( testAccMetalDeviceExists(r, &device), ), @@ -366,7 +385,7 @@ func TestAccMetalDevice_IPXEConfigMissing(t *testing.T) { CheckDestroy: testAccMetalDeviceCheckDestroyed, Steps: []resource.TestStep{ { - Config: fmt.Sprintf(testAccMetalDeviceConfig_ipxe_missing, confAccMetalDevice_base(preferable_plans, preferable_metros), rs), + Config: fmt.Sprintf(testAccMetalDeviceConfig_ipxe_missing, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), rs), Check: resource.ComposeTestCheckFunc( testAccMetalDeviceExists(r, &device), ), @@ -551,7 +570,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device-%d" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" tags = ["%d"] @@ -564,7 +583,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, rInt, rInt, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, rInt, rInt, testDeviceTerminationTime()) } func testAccMetalDeviceConfig_reinstall(rInt int, projSuffix string) string { @@ -579,7 +598,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device-%d" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" tags = ["%d"] @@ -598,7 +617,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, rInt, rInt, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, rInt, rInt, testDeviceTerminationTime()) } func testAccMetalDeviceConfig_varname(rInt int, projSuffix string) string { @@ -614,7 +633,7 @@ resource "equinix_metal_device" "test" { description = "test-desc-%d" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" tags = ["%d"] @@ -627,7 +646,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, rInt, rInt, rInt, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, rInt, rInt, rInt, testDeviceTerminationTime()) } func testAccMetalDeviceConfig_varname_pxe(rInt int, projSuffix string) string { @@ -643,7 +662,7 @@ resource "equinix_metal_device" "test" { description = "test-desc-%d" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" tags = ["%d"] @@ -658,7 +677,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, rInt, rInt, rInt, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, rInt, rInt, rInt, testDeviceTerminationTime()) } func testAccMetalDeviceConfig_metro(projSuffix string) string { @@ -673,7 +692,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" termination_time = "%s" @@ -685,7 +704,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, testDeviceTerminationTime()) } func testAccMetalDeviceConfig_minimal(projSuffix string) string { @@ -699,7 +718,7 @@ resource "equinix_metal_project" "test" { resource "equinix_metal_device" "test" { plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os project_id = "${equinix_metal_project.test.id}" lifecycle { @@ -708,7 +727,7 @@ resource "equinix_metal_device" "test" { metro, ] } -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix) } func testAccMetalDeviceConfig_basic(projSuffix string) string { @@ -724,7 +743,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-test-device" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" termination_time = "%s" @@ -735,11 +754,13 @@ resource "equinix_metal_device" "test" { metro, ] } -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, testDeviceTerminationTime()) } func testAccMetalDeviceConfig_ssh_key(projSuffix, userSSSHKey, projSSHKey string) string { return fmt.Sprintf(` +%s + resource "equinix_metal_project" "test" { name = "tfacc-device-%s" } @@ -757,15 +778,22 @@ resource "equinix_metal_project_ssh_key" "test" { resource "equinix_metal_device" "test" { hostname = "tfacc-test-device" - plan = "c3.small.x86" - metro = "sv" - operating_system = "ubuntu_16_04" + plan = local.plan + metro = local.metro + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id user_ssh_key_ids = [equinix_metal_ssh_key.test.id] project_ssh_key_ids = [equinix_metal_project_ssh_key.test.id] + + lifecycle { + ignore_changes = [ + plan, + metro, + ] + } } -`, projSSHKey, projSSHKey, userSSSHKey, projSSHKey, projSSHKey) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSSHKey, projSSHKey, userSSSHKey, projSSHKey, projSSHKey) } func testAccMetalDeviceConfig_facility_list(projSuffix string) string { @@ -781,7 +809,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-test-ipxe-script-url" plan = local.plan facilities = local.facilities - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" termination_time = "%s" @@ -792,7 +820,7 @@ resource "equinix_metal_device" "test" { facilities, ] } -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, testDeviceTerminationTime()) } func testAccMetalDeviceConfig_ipxe_script_url(projSuffix, url, pxe string) string { @@ -822,7 +850,7 @@ resource "equinix_metal_device" "test_ipxe_script_url" { metro, ] } -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), projSuffix, url, pxe, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix, url, pxe, testDeviceTerminationTime()) } var testAccMetalDeviceConfig_ipxe_conflict = ` diff --git a/equinix/resource_metal_ip_attachment_acc_test.go b/equinix/resource_metal_ip_attachment_acc_test.go index eae95cf30..6a6c54428 100644 --- a/equinix/resource_metal_ip_attachment_acc_test.go +++ b/equinix/resource_metal_ip_attachment_acc_test.go @@ -48,7 +48,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-ip-attachment-test" plan = local.plan facilities = local.facilities - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -70,7 +70,7 @@ resource "equinix_metal_reserved_ip_block" "test" { resource "equinix_metal_ip_attachment" "test" { device_id = equinix_metal_device.test.id cidr_notation = "${cidrhost(equinix_metal_reserved_ip_block.test.cidr_notation,0)}/32" -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func TestAccMetalIPAttachment_metro(t *testing.T) { @@ -112,7 +112,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-ip-attachment-test" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -135,7 +135,7 @@ resource "equinix_metal_reserved_ip_block" "test" { resource "equinix_metal_ip_attachment" "test" { device_id = equinix_metal_device.test.id cidr_notation = "${cidrhost(equinix_metal_reserved_ip_block.test.cidr_notation,0)}/32" -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func testAccMetalIPAttachmentCheckDestroyed(s *terraform.State) error { diff --git a/equinix/resource_metal_port_acc_test.go b/equinix/resource_metal_port_acc_test.go index 3a42abed9..4b19b173a 100644 --- a/equinix/resource_metal_port_acc_test.go +++ b/equinix/resource_metal_port_acc_test.go @@ -22,7 +22,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-metal-port-test" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = "${equinix_metal_project.test.id}" termination_time = "%s" @@ -41,7 +41,7 @@ locals { eth0_id = [for p in equinix_metal_device.test.ports: p.id if p.name == "eth0"][0] } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func confAccMetalPort_L3(name string) string { diff --git a/equinix/resource_metal_port_vlan_attachment_acc_test.go b/equinix/resource_metal_port_vlan_attachment_acc_test.go index d509af8ff..df09a7fbe 100644 --- a/equinix/resource_metal_port_vlan_attachment_acc_test.go +++ b/equinix/resource_metal_port_vlan_attachment_acc_test.go @@ -23,7 +23,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-port-vlan-attachment-test" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -35,7 +35,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func testAccMetalPortVlanAttachmentConfig_L2Bonded_2(name string) string { @@ -117,7 +117,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-vlan-l2i-test" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -129,7 +129,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func testAccMetalPortVlanAttachmentConfig_L2Individual_2(name string) string { @@ -213,7 +213,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-hybrid-test" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -224,7 +224,7 @@ resource "equinix_metal_device" "test" { metro, ] } -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func testAccMetalPortVlanAttachmentConfig_Hybrid_2(name string) string { @@ -293,7 +293,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-hmv-test" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -304,7 +304,7 @@ resource "equinix_metal_device" "test" { metro, ] } -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func testAccMetalPortVlanAttachmentConfig_HybridMultipleVlans_2(name string) string { @@ -416,7 +416,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-l2n-test" plan = local.plan metro = local.metro - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_id = equinix_metal_project.test.id termination_time = "%s" @@ -427,7 +427,7 @@ resource "equinix_metal_device" "test" { metro, ] } -}`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func testAccMetalPortVlanAttachmentConfig_L2Native_2(name string) string { diff --git a/equinix/resource_metal_project_ssh_key_acc_test.go b/equinix/resource_metal_project_ssh_key_acc_test.go index f038dfb27..8cca9124e 100644 --- a/equinix/resource_metal_project_ssh_key_acc_test.go +++ b/equinix/resource_metal_project_ssh_key_acc_test.go @@ -28,7 +28,7 @@ resource "equinix_metal_device" "test" { hostname = "tfacc-device-key-test" plan = local.plan facilities = local.facilities - operating_system = "ubuntu_16_04" + operating_system = local.os billing_cycle = "hourly" project_ssh_key_ids = ["${equinix_metal_project_ssh_key.test.id}"] project_id = "${equinix_metal_project.test.id}" @@ -42,7 +42,7 @@ resource "equinix_metal_device" "test" { } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, publicSshKey, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, publicSshKey, testDeviceTerminationTime()) } func TestAccMetalProjectSSHKey_basic(t *testing.T) { diff --git a/equinix/resource_metal_reserved_ip_block.go b/equinix/resource_metal_reserved_ip_block.go index fdc5257af..ff193fbe8 100644 --- a/equinix/resource_metal_reserved_ip_block.go +++ b/equinix/resource_metal_reserved_ip_block.go @@ -112,13 +112,13 @@ func resourceMetalReservedIPBlock() *schema.Resource { // if facility is not in state, treat the diff normally, otherwise do following messy checks: if facOk { - // If metro from HCL is specified, but not present in state, supress the diff. + // If metro from HCL is specified, but not present in state, suppress the diff. // This is legacy, and I think it's here because of migration, so that old // facility reservations are not recreated when metro is specified ???) if fromHCL != "" && fromState == "" { return true } - // If metro is present in state but not present in HCL, supress the diff. + // If metro is present in state but not present in HCL, suppress the diff. // This is for "facility-specified" reservation blocks created after ~July 2021. // These blocks will have metro "computed" to the TF state, and we don't want to // emit a diff if the metro field is empty in HCL. @@ -285,7 +285,7 @@ func resourceMetalReservedIPBlockCreate(d *schema.ResourceData, meta interface{} blockAddr, _, err := client.ProjectIPs.Create(projectID, &req) if err != nil { - return fmt.Errorf("urror reserving IP address block: %s", err) + return fmt.Errorf("error reserving IP address block: %s", err) } d.Set("project_id", projectID) d.SetId(blockAddr.ID) @@ -311,7 +311,7 @@ func resourceMetalReservedIPBlockCreate(d *schema.ResourceData, meta interface{} } func resourceMetalReservedIPBlockUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*packngo.Client) + client := meta.(*Config).metal id := d.Id() req := &packngo.IPAddressUpdateRequest{} if d.HasChange("tags") { diff --git a/equinix/resource_metal_reserved_ip_block_acc_test.go b/equinix/resource_metal_reserved_ip_block_acc_test.go index 0b2ce89b7..8ebc3bc23 100644 --- a/equinix/resource_metal_reserved_ip_block_acc_test.go +++ b/equinix/resource_metal_reserved_ip_block_acc_test.go @@ -1,8 +1,10 @@ package equinix import ( + "bytes" "fmt" "testing" + "text/template" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -18,12 +20,12 @@ resource "equinix_metal_project" "foobar" { resource "equinix_metal_reserved_ip_block" "test" { project_id = equinix_metal_project.foobar.id type = "global_ipv4" - description = "testdesc" + description = "tfacc-reserved_ip_block-%s" quantity = 1 custom_data = jsonencode({ "foo": "bar" }) -}`, name) +}`, name, name) } func testAccMetalReservedIPBlockConfig_public(name string) string { @@ -36,23 +38,34 @@ resource "equinix_metal_reserved_ip_block" "test" { project_id = equinix_metal_project.foobar.id facility = "ny5" type = "public_ipv4" + description = "tfacc-reserved_ip_block-%s" quantity = 2 tags = ["Tag1", "Tag2"] -}`, name) +}`, name, name) } -func testAccMetalReservedIPBlockConfig_metro(name string) string { - return fmt.Sprintf(` -resource "equinix_metal_project" "foobar" { - name = "tfacc-reserved_ip_block-%s" -} +// testAccMetalReservedIPBlockConfig_metro generates a config for a metro IP +// block with optional tag +func testAccMetalReservedIPBlockConfig_metro(name, tag string) string { + var b bytes.Buffer + t, _ := template.New("").Parse(` + resource "equinix_metal_project" "foobar" { + name = "tfacc-reserved_ip_block-{{.name}}" + } -resource "equinix_metal_reserved_ip_block" "test" { - project_id = equinix_metal_project.foobar.id - metro = "sv" - type = "public_ipv4" - quantity = 2 -}`, name) + resource "equinix_metal_reserved_ip_block" "test" { + project_id = equinix_metal_project.foobar.id + metro = "sv" + type = "public_ipv4" + description = "tfacc-reserved_ip_block-{{.tag}}" + quantity = 2 + {{if .tag}} + tags = [{{.tag | printf "%q"}}] + {{end}} + }`) + t.Execute(&b, map[string]string{"name": name, "tag": tag}) + + return b.String() } func TestAccMetalReservedIPBlock_global(t *testing.T) { @@ -69,7 +82,7 @@ func TestAccMetalReservedIPBlock_global(t *testing.T) { resource.TestCheckResourceAttr( "equinix_metal_reserved_ip_block.test", "quantity", "1"), resource.TestCheckResourceAttr( - "equinix_metal_reserved_ip_block.test", "description", "testdesc"), + "equinix_metal_reserved_ip_block.test", "description", "tfacc-reserved_ip_block-"+rs), resource.TestCheckResourceAttr( "equinix_metal_reserved_ip_block.test", "type", "global_ipv4"), resource.TestCheckResourceAttr( @@ -121,6 +134,7 @@ func TestAccMetalReservedIPBlock_public(t *testing.T) { func TestAccMetalReservedIPBlock_metro(t *testing.T) { rs := acctest.RandString(10) + tag := "tag" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -128,10 +142,29 @@ func TestAccMetalReservedIPBlock_metro(t *testing.T) { CheckDestroy: testAccMetalReservedIPBlockCheckDestroyed, Steps: []resource.TestStep{ { - Config: testAccMetalReservedIPBlockConfig_metro(rs), + Config: testAccMetalReservedIPBlockConfig_metro(rs, tag), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "equinix_metal_reserved_ip_block.test", "metro", "sv"), + resource.TestCheckResourceAttr("equinix_metal_reserved_ip_block.test", "tags.0", tag), + resource.TestCheckResourceAttr( + "equinix_metal_reserved_ip_block.test", "description", "tfacc-reserved_ip_block-"+tag), + ), + }, + { + ResourceName: "equinix_metal_reserved_ip_block.test", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"wait_for_state"}, + }, + { + Config: testAccMetalReservedIPBlockConfig_metro(rs, ""), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "equinix_metal_reserved_ip_block.test", "metro", "sv"), + resource.TestCheckResourceAttr("equinix_metal_reserved_ip_block.test", "tags.#", "0"), + resource.TestCheckResourceAttr( + "equinix_metal_reserved_ip_block.test", "description", "tfacc-reserved_ip_block-"), ), }, }, @@ -220,27 +253,28 @@ func testAccMetalReservedIP_device(name string) string { return fmt.Sprintf(` %s -locals { - facility_list = tolist(local.facilities) - selected_facility = local.facility_list[length(local.facility_list) - 1] -} - resource "equinix_metal_project" "foobar" { name = "tfacc-reserved_ip_block-%s" } resource "equinix_metal_reserved_ip_block" "test" { project_id = equinix_metal_project.foobar.id - facility = local.selected_facility + facility = local.facility type = "public_ipv4" quantity = 2 + + lifecycle { + ignore_changes = [ + facility, + ] + } } resource "equinix_metal_device" "test" { project_id = equinix_metal_project.foobar.id plan = local.plan - facilities = [local.selected_facility] - operating_system = "ubuntu_16_04" + facilities = [local.facility] + operating_system = local.os hostname = "tfacc-reserved-ip-device" billing_cycle = "hourly" ip_address { @@ -260,7 +294,7 @@ resource "equinix_metal_device" "test" { ] } } -`, confAccMetalDevice_base(preferable_plans, preferable_metros), name, testDeviceTerminationTime()) +`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), name, testDeviceTerminationTime()) } func TestAccMetalReservedIPBlock_device(t *testing.T) { diff --git a/equinix/resource_metal_spot_market_request_acc_test.go b/equinix/resource_metal_spot_market_request_acc_test.go index e32630c74..3a765e359 100644 --- a/equinix/resource_metal_spot_market_request_acc_test.go +++ b/equinix/resource_metal_spot_market_request_acc_test.go @@ -12,18 +12,15 @@ import ( func TestAccMetalSpotMarketRequest_basic(t *testing.T) { var key packngo.SpotMarketRequest - context := map[string]interface{}{ - "name_suffix": acctest.RandString(10), - "facility": "sv15", - "plan": "c3.small.x86", - } + projSuffix := acctest.RandString(10) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccMetalSpotMarketRequestCheckDestroyed, Steps: []resource.TestStep{ { - Config: testAccMetalSpotMarketRequestConfig_basic(context), + Config: testAccMetalSpotMarketRequestConfig_basic(projSuffix), Check: resource.ComposeTestCheckFunc( testAccCheckMetalSpotMarketRequestExists("equinix_metal_spot_market_request.request", &key), resource.TestCheckResourceAttr("equinix_metal_spot_market_request.request", "devices_max", "1"), @@ -76,25 +73,27 @@ func testAccCheckMetalSpotMarketRequestExists(n string, key *packngo.SpotMarketR } } -func testAccMetalSpotMarketRequestConfig_basic(ctx map[string]interface{}) string { - return nprintf(` +func testAccMetalSpotMarketRequestConfig_basic(projSuffix string) string { + return fmt.Sprintf(` +%s + resource "equinix_metal_project" "test" { - name = "tfacc-spot_market_request-%{name_suffix}" + name = "tfacc-spot_market_request-%s" } data "equinix_metal_spot_market_price" "test" { - facility = "%{facility}" - plan = "%{plan}" + facility = local.facility + plan = local.plan } data "equinix_metal_spot_market_request" "dreq" { - request_id = equinix_metal_spot_market_request.request.id + request_id = equinix_metal_spot_market_request.request.id } resource "equinix_metal_spot_market_request" "request" { project_id = equinix_metal_project.test.id max_bid_price = data.equinix_metal_spot_market_price.test.price * 1.2 - facilities = ["%{facility}"] + facilities = [data.equinix_metal_spot_market_price.test.facility] devices_min = 1 devices_max = 1 wait_for_devices = true @@ -102,27 +101,36 @@ resource "equinix_metal_spot_market_request" "request" { instance_parameters { hostname = "tfacc-testspot" billing_cycle = "hourly" - operating_system = "ubuntu_18_04" - plan = "%{plan}" + operating_system = local.os + plan = local.plan + } + + lifecycle { + ignore_changes = [ + instance_parameters, + facilities, + ] } -}`, ctx) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix) } -func testAccCheckMetalSpotMarketRequestConfig_import(ctx map[string]interface{}) string { - return nprintf(` +func testAccCheckMetalSpotMarketRequestConfig_import(projSuffix string) string { + return fmt.Sprintf(` +%s + resource "equinix_metal_project" "test" { - name = "tfacc-spot_market_request-%{name_suffix}" + name = "tfacc-spot_market_request-%s" } data "equinix_metal_spot_market_price" "test" { - facility = "%{facility}" - plan = "%{plan}" + facility = local.facility + plan = local.plan } resource "equinix_metal_spot_market_request" "request" { project_id = equinix_metal_project.test.id max_bid_price = data.equinix_metal_spot_market_price.test.price * 1.2 - facilities = ["%{facility}"] + facilities = [data.equinix_metal_spot_market_price.test.facility] devices_min = 1 devices_max = 1 wait_for_devices = true @@ -130,25 +138,29 @@ resource "equinix_metal_spot_market_request" "request" { instance_parameters { hostname = "tfacc-testspot" billing_cycle = "hourly" - operating_system = "ubuntu_20_04" - plan = "%{plan}" + operating_system = local.os + plan = local.plan + } + + lifecycle { + ignore_changes = [ + instance_parameters, + facilities, + ] } -}`, ctx) +}`, confAccMetalDevice_base(preferable_plans, preferable_metros, preferable_os), projSuffix) } func TestAccMetalSpotMarketRequest_Import(t *testing.T) { - context := map[string]interface{}{ - "name_suffix": acctest.RandString(10), - "facility": "sv15", - "plan": "c3.small.x86", - } + projSuffix := acctest.RandString(10) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccMetalSpotMarketRequestCheckDestroyed, Steps: []resource.TestStep{ { - Config: testAccCheckMetalSpotMarketRequestConfig_import(context), + Config: testAccCheckMetalSpotMarketRequestConfig_import(projSuffix), }, { ResourceName: "equinix_metal_spot_market_request.request", diff --git a/go.mod b/go.mod index a901675c3..84447b77f 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/googleapis/gax-go/v2 v2.0.5 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.5.11 // indirect + github.com/hashicorp/go-getter v1.6.1 // indirect github.com/hashicorp/go-hclog v0.15.0 // indirect github.com/hashicorp/go-plugin v1.4.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect @@ -67,7 +67,7 @@ require ( golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/mod v0.4.2 // indirect golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect - golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 // indirect + golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e // indirect golang.org/x/text v0.3.6 // indirect golang.org/x/tools v0.1.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect diff --git a/go.sum b/go.sum index 3517cc17a..ddf68149d 100644 --- a/go.sum +++ b/go.sum @@ -201,8 +201,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= -github.com/hashicorp/go-getter v1.5.11 h1:wioTuNmaBU3IE9vdFtFMcmZWj0QzLc6DYaP6sNe5onY= -github.com/hashicorp/go-getter v1.5.11/go.mod h1:9i48BP6wpWweI/0/+FBjqLrp9S8XtwUGjiu0QkWHEaY= +github.com/hashicorp/go-getter v1.6.1 h1:NASsgP4q6tL94WH6nJxKWj8As2H/2kop/bB1d8JMyRY= +github.com/hashicorp/go-getter v1.6.1/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= @@ -520,8 +520,9 @@ golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 h1:RX8C8PRZc2hTIod4ds8ij+/4RQX3AqhYj3uOHmyaz4E= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e h1:w36l2Uw3dRan1K3TyXriXvY+6T56GNmlKGcqiQUJDfM= +golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/version/version.go b/version/version.go index 50b6f20ed..8b08f6b4d 100644 --- a/version/version.go +++ b/version/version.go @@ -1,6 +1,4 @@ package version -var ( - // ProviderVersion is set at build-time in the release process - ProviderVersion = "dev" -) +// ProviderVersion is set at build-time in the release process +var ProviderVersion = "dev"