Skip to content

Commit db210d6

Browse files
committed
Bug Fix - enabled preserve_data_volumes in oci_core_instance delete API and host_type in opsi_host_insights_data_source list api
1 parent db049aa commit db210d6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

internal/service/core/core_instance_resource.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,10 @@ func (s *CoreInstanceResourceCrud) Delete() error {
12671267
request.PreserveBootVolume = &tmp
12681268
}
12691269

1270-
// if preserveDataVolumes, ok := s.D.GetOkExists("preserve_data_volumes"); ok {
1271-
// tmp := preserveDataVolumes.(bool)
1272-
// request.PreserveDataVolumes = &tmp
1273-
// }
1270+
if preserveDataVolumes, ok := s.D.GetOkExists("preserve_data_volumes"); ok {
1271+
tmp := preserveDataVolumes.(bool)
1272+
request.PreserveBootVolume = &tmp
1273+
}
12741274

12751275
request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "core")
12761276

internal/service/opsi/opsi_host_insights_data_source.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package opsi
55

66
import (
77
"context"
8-
98
"github.com/oracle/terraform-provider-oci/internal/client"
109
"github.com/oracle/terraform-provider-oci/internal/tfresource"
1110

@@ -110,14 +109,15 @@ func (s *OpsiHostInsightsDataSourceCrud) Get() error {
110109

111110
if hostType, ok := s.D.GetOkExists("host_type"); ok {
112111
interfaces := hostType.([]interface{})
113-
tmp := make([]oci_opsi.ListHostInsightsPlatformTypeEnum, len(interfaces))
112+
tmp := make([]oci_opsi.ListHostInsightsHostTypeEnum, len(interfaces))
114113
for i := range interfaces {
115114
if interfaces[i] != nil {
116-
tmp[i] = interfaces[i].(oci_opsi.ListHostInsightsPlatformTypeEnum)
115+
hostType := interfaces[i].(string)
116+
tmp[i] = oci_opsi.ListHostInsightsHostTypeEnum(hostType)
117117
}
118118
}
119119
if len(tmp) != 0 || s.D.HasChange("host_type") {
120-
// request.HostType = tmp
120+
request.HostType = tmp
121121
}
122122
}
123123

0 commit comments

Comments
 (0)