Skip to content

Commit efa7a1c

Browse files
committed
Move compute instance's capacity reservation id change to the same request as shape
Fixes oracle#2313 Signed-off-by: Ben Dean <[email protected]>
1 parent 97b6ff8 commit efa7a1c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

internal/service/core/core_instance_resource.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ func (s *CoreInstanceResourceCrud) Update() error {
14671467
}
14681468
}
14691469

1470-
// Update shape, shape config, platform config, source details, fault domain and launch options
1470+
// Update shape, shape config, platform config, source details, fault domain, launch options, and capacity reservation
14711471
err := s.updateOptionsViaWorkRequest()
14721472

14731473
if err != nil {
@@ -1501,10 +1501,6 @@ func (s *CoreInstanceResourceCrud) Update() error {
15011501
}
15021502
}
15031503

1504-
if capacityReservationId, ok := s.D.GetOkExists("capacity_reservation_id"); ok {
1505-
tmp := capacityReservationId.(string)
1506-
request.CapacityReservationId = &tmp
1507-
}
15081504
if dedicatedVmHostId, ok := s.D.GetOkExists("dedicated_vm_host_id"); ok {
15091505
tmp := dedicatedVmHostId.(string)
15101506
request.DedicatedVmHostId = &tmp
@@ -4075,6 +4071,11 @@ func (s *CoreInstanceResourceCrud) updateOptionsViaWorkRequest() error {
40754071
}
40764072
}
40774073

4074+
if capacityReservationId, ok := s.D.GetOkExists("capacity_reservation_id"); ok {
4075+
tmp := capacityReservationId.(string)
4076+
request.CapacityReservationId = &tmp
4077+
}
4078+
40784079
if platformConfig, ok := s.D.GetOkExists("platform_config"); ok && s.D.HasChange("platform_config") {
40794080
if tmpList := platformConfig.([]interface{}); len(tmpList) > 0 {
40804081
fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "platform_config", 0)

0 commit comments

Comments
 (0)