Skip to content

Commit e5954b8

Browse files
Merge pull request #1188 from terraform-providers/revert_change
revert break changes
2 parents 38a20c9 + 60a78b2 commit e5954b8

File tree

2 files changed

+0
-75
lines changed

2 files changed

+0
-75
lines changed

oci/core_instance_resource.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,16 +1844,6 @@ func (s *CoreInstanceResourceCrud) updateOptionsViaWorkRequest() error {
18441844
if newRaw != "" && oldRaw != "" {
18451845
shapeTmp := shape.(string)
18461846
request.Shape = &shapeTmp
1847-
if shapeConfig, ok := s.D.GetOkExists("shape_config"); ok && !s.D.HasChange("shape_config") {
1848-
if tmpList := shapeConfig.([]interface{}); len(tmpList) > 0 {
1849-
fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "shape_config", 0)
1850-
tmp, err := s.mapToUpdateInstanceShapeConfigDetails(fieldKeyFormat)
1851-
if err != nil {
1852-
return err
1853-
}
1854-
request.ShapeConfig = &tmp
1855-
}
1856-
}
18571847
}
18581848
}
18591849

oci/core_instance_resource_test.go

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,6 @@ var (
4343
"ocpus": Representation{repType: Optional, create: "2"},
4444
"memory_in_gbs": Representation{repType: Optional, create: `10.0`, update: `20.0`},
4545
}
46-
instanceShapeConfigRepresentation_ForFlexibleMemoryNoUpdate = map[string]interface{}{
47-
"ocpus": Representation{repType: Optional, create: "2"},
48-
"memory_in_gbs": Representation{repType: Optional, create: `10.0`, update: `20.0`},
49-
}
50-
instanceRepresentationCore_ForFlexibleMemoryNoUpdate = representationCopyWithRemovedProperties(representationCopyWithNewProperties(instanceRepresentation, map[string]interface{}{
51-
"fault_domain": Representation{repType: Optional, create: `FAULT-DOMAIN-3`, update: `FAULT-DOMAIN-2`},
52-
"shape": Representation{repType: Required, create: `VM.Standard.E3.Flex`},
53-
"image": Representation{repType: Required, create: `${var.FlexInstanceImageOCID[var.region]}`},
54-
"shape_config": RepresentationGroup{Optional, instanceShapeConfigRepresentation_ForFlexibleMemoryNoUpdate},
55-
"source_details": RepresentationGroup{Optional, instanceFlexSourceDetailsRepresentation},
56-
}), []string{
57-
"dedicated_vm_host_id",
58-
})
5946
instanceLaunchOptionsRepresentation_ForLaunchOptionsUpdate = representationCopyWithNewProperties(instanceLaunchOptionsRepresentation, map[string]interface{}{
6047
"boot_volume_type": Representation{repType: Optional, create: `ISCSI`, update: `PARAVIRTUALIZED`},
6148
"is_pv_encryption_in_transit_enabled": Representation{repType: Optional, update: `true`},
@@ -1834,58 +1821,6 @@ func TestAccResourceCoreInstance_FlexibleMemory(t *testing.T) {
18341821
),
18351822
},
18361823

1837-
// verify updates to updatable parameters but no change in shape_config
1838-
{
1839-
Config: config + compartmentIdVariableStr + InstanceResourceDependenciesWithoutDHV + FlexVmImageIdsVariable +
1840-
generateResourceFromRepresentationMap("oci_core_instance", "test_instance", Optional, Update, instanceRepresentationCore_ForFlexibleMemoryNoUpdate),
1841-
Check: resource.ComposeAggregateTestCheckFunc(
1842-
resource.TestCheckResourceAttr(resourceName, "agent_config.#", "1"),
1843-
resource.TestCheckResourceAttr(resourceName, "agent_config.0.is_management_disabled", "true"),
1844-
resource.TestCheckResourceAttr(resourceName, "agent_config.0.is_monitoring_disabled", "true"),
1845-
resource.TestCheckResourceAttrSet(resourceName, "availability_domain"),
1846-
resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId),
1847-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.#", "1"),
1848-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.assign_public_ip", "true"),
1849-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.defined_tags.%", "1"),
1850-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.display_name", "displayName"),
1851-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.freeform_tags.%", "1"),
1852-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.hostname_label", "hostnamelabel"),
1853-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.nsg_ids.#", "0"),
1854-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.private_ip", "10.0.0.5"),
1855-
resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.skip_source_dest_check", "false"),
1856-
resource.TestCheckResourceAttrSet(resourceName, "create_vnic_details.0.subnet_id"),
1857-
resource.TestCheckResourceAttr(resourceName, "defined_tags.%", "1"),
1858-
resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"),
1859-
resource.TestCheckResourceAttr(resourceName, "extended_metadata.%", "3"),
1860-
resource.TestCheckResourceAttr(resourceName, "fault_domain", "FAULT-DOMAIN-2"),
1861-
resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"),
1862-
resource.TestCheckResourceAttr(resourceName, "hostname_label", "hostnamelabel"),
1863-
resource.TestCheckResourceAttrSet(resourceName, "id"),
1864-
resource.TestCheckResourceAttrSet(resourceName, "image"),
1865-
resource.TestCheckResourceAttr(resourceName, "ipxe_script", "ipxeScript"),
1866-
resource.TestCheckResourceAttr(resourceName, "is_pv_encryption_in_transit_enabled", "false"),
1867-
resource.TestCheckResourceAttr(resourceName, "metadata.%", "2"),
1868-
resource.TestCheckResourceAttrSet(resourceName, "region"),
1869-
resource.TestCheckResourceAttr(resourceName, "shape", "VM.Standard.E3.Flex"),
1870-
resource.TestCheckResourceAttr(resourceName, "shape_config.#", "1"),
1871-
resource.TestCheckResourceAttr(resourceName, "shape_config.0.memory_in_gbs", "20"),
1872-
resource.TestCheckResourceAttr(resourceName, "source_details.#", "1"),
1873-
resource.TestCheckResourceAttrSet(resourceName, "source_details.0.source_id"),
1874-
resource.TestCheckResourceAttr(resourceName, "source_details.0.source_type", "image"),
1875-
resource.TestCheckResourceAttr(resourceName, "state", "RUNNING"),
1876-
resource.TestCheckResourceAttrSet(resourceName, "subnet_id"),
1877-
resource.TestCheckResourceAttrSet(resourceName, "time_created"),
1878-
1879-
func(s *terraform.State) (err error) {
1880-
resId2, err = fromInstanceState(s, resourceName, "id")
1881-
if resId != resId2 {
1882-
return fmt.Errorf("Resource recreated when it was supposed to be updated.")
1883-
}
1884-
return err
1885-
},
1886-
),
1887-
},
1888-
18891824
// verify updates to updatable parameters
18901825
{
18911826
Config: config + compartmentIdVariableStr + InstanceResourceDependenciesWithoutDHV + FlexVmImageIdsVariable +

0 commit comments

Comments
 (0)