diff --git a/equinix/resource_metal_port_acc_test.go b/equinix/resource_metal_port_acc_test.go index 113dbe694..8a7ca65d6 100644 --- a/equinix/resource_metal_port_acc_test.go +++ b/equinix/resource_metal_port_acc_test.go @@ -237,10 +237,10 @@ resource "equinix_metal_vlan" "test" { func TestAccMetalPort_hybridBondedVxlan(t *testing.T) { rs := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ExternalProviders: testExternalProviders, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccMetalPortDestroyed, + PreCheck: func() { testAccPreCheck(t) }, + ExternalProviders: testExternalProviders, + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + CheckDestroy: testAccMetalPortDestroyed, Steps: []resource.TestStep{ { Config: confAccMetalPort_HybridBondedVxlan(rs), @@ -266,10 +266,10 @@ func TestAccMetalPort_hybridBondedVxlan(t *testing.T) { func TestAccMetalPort_L2IndividualNativeVlan(t *testing.T) { rs := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ExternalProviders: testExternalProviders, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccMetalPortDestroyed, + PreCheck: func() { testAccPreCheck(t) }, + ExternalProviders: testExternalProviders, + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + CheckDestroy: testAccMetalPortDestroyed, Steps: []resource.TestStep{ { Config: confAccMetalPort_L2IndividualNativeVlan(rs), @@ -299,10 +299,10 @@ func TestAccMetalPort_L2IndividualNativeVlan(t *testing.T) { func testAccMetalPortTemplate(t *testing.T, conf func(string) string, expectedType string) { rs := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ExternalProviders: testExternalProviders, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccMetalPortDestroyed, + PreCheck: func() { testAccPreCheck(t) }, + ExternalProviders: testExternalProviders, + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + CheckDestroy: testAccMetalPortDestroyed, Steps: []resource.TestStep{ { Config: conf(rs), @@ -422,10 +422,10 @@ func TestAccMetalPortCreate_hybridBonded_timeout(t *testing.T) { deviceName := "equinix_metal_device.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ExternalProviders: testExternalProviders, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccMetalPortDestroyed, + PreCheck: func() { testAccPreCheck(t) }, + ExternalProviders: testExternalProviders, + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + CheckDestroy: testAccMetalPortDestroyed, Steps: []resource.TestStep{ { Config: confAccMetalPort_HybridBonded_timeout(rInt, rs, "5s", ""), @@ -463,10 +463,10 @@ func TestAccMetalPortUpdate_hybridBonded_timeout(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ExternalProviders: testExternalProviders, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccMetalPortDestroyed, + PreCheck: func() { testAccPreCheck(t) }, + ExternalProviders: testExternalProviders, + ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, + CheckDestroy: testAccMetalPortDestroyed, Steps: []resource.TestStep{ { Config: confAccMetalPort_HybridBonded_timeout(rInt, rs, "", "5s"), diff --git a/internal/resources/metal/vlans/models.go b/internal/resources/metal/vlans/models.go index e66708317..197744d30 100644 --- a/internal/resources/metal/vlans/models.go +++ b/internal/resources/metal/vlans/models.go @@ -19,7 +19,11 @@ type DataSourceModel struct { func (m *DataSourceModel) parse(vlan *packngo.VirtualNetwork) diag.Diagnostics { m.ID = types.StringValue(vlan.ID) - m.ProjectID = types.StringValue(vlan.Project.ID) + + if vlan.Project.ID != "" { + m.ProjectID = types.StringValue(vlan.Project.ID) + } + m.VlanID = types.StringValue(vlan.ID) m.Facility = types.StringNull() @@ -50,7 +54,10 @@ type ResourceModel struct { func (m *ResourceModel) parse(vlan *packngo.VirtualNetwork) diag.Diagnostics { m.ID = types.StringValue(vlan.ID) - m.ProjectID = types.StringValue(vlan.Project.ID) + + if vlan.Project.ID != "" { + m.ProjectID = types.StringValue(vlan.Project.ID) + } m.Facility = types.StringNull() if vlan.FacilityCode != "" {