Skip to content

Commit 802d289

Browse files
committed
format changes to match established standards
1 parent 70e7aa4 commit 802d289

File tree

43 files changed

+123
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+123
-76
lines changed

oci/database_autonomous_data_warehouse_resource.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ func DatabaseAutonomousDataWarehouseResource() *schema.Resource {
4141
Required: true,
4242
},
4343
"db_name": {
44-
Type: schema.TypeString,
45-
Required: true,
46-
ForceNew: true,
47-
// TODO: Move the deprecation message to resource schema post Terraform v12 upgrade
44+
Type: schema.TypeString,
45+
Required: true,
46+
ForceNew: true,
4847
Deprecated: ResourceDeprecatedForAnother("oci_database_autonomous_data_warehouse", "oci_database_autonomous_database"),
4948
},
5049

oci/database_data_guard_association_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ func TestDatabaseDataGuardAssociationResource_basic(t *testing.T) {
275275
resource.TestCheckResourceAttr(singularDatasourceName, "transport_type", "ASYNC"),
276276
),
277277
},
278-
// @CODEGEN We need to remove the import because the import step removed the dependency relationship between the DGA and the peer dbSystem and the delete will fail without it.
279278
},
280279
})
281280
}

oci/database_db_home_data_source.go

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

55
import (
66
"context"
7-
"fmt"
87

98
"github.com/hashicorp/terraform/helper/schema"
109
oci_database "github.com/oracle/oci-go-sdk/database"
@@ -42,10 +41,6 @@ func (s *DatabaseDbHomeDataSourceCrud) Get() error {
4241

4342
if dbHomeId, ok := s.D.GetOkExists("db_home_id"); ok {
4443
tmp := dbHomeId.(string)
45-
if len(tmp) == 0 {
46-
return fmt.Errorf("db_home_id must contain a valid ocid")
47-
}
48-
4944
request.DbHomeId = &tmp
5045
}
5146

oci/database_db_home_resource.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ func DatabaseDbHomeResource() *schema.Resource {
184184
Required: true,
185185
ForceNew: true,
186186
},
187+
188+
// Optional
187189
"db_version": {
188190
Type: schema.TypeString,
189191
Optional: true,
190192
Computed: true,
191-
ForceNew: true,
193+
ForceNew: true, // @CODEGEN we don't currently support updates to dbVersion because the update operation takes a patchId instead of a new version
192194
DiffSuppressFunc: NewIsPrefixOfOldDiffSuppress,
193195
},
194-
195-
// Optional
196196
"display_name": {
197197
Type: schema.TypeString,
198198
Optional: true,

oci/database_db_homes_data_source.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,3 @@ func (s *DatabaseDbHomesDataSourceCrud) SetData() error {
152152

153153
return nil
154154
}
155-
156-
// @CODEGEN 08/2018: Methods CreateDatabaseDetailsToMap, CreateDatabaseFromBackupDetailsToMap and DbBackupConfigToMap are available in database_db_system_resource.go

oci/database_db_nodes_data_source.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ func (s *DatabaseDbNodesDataSourceCrud) SetData() error {
143143
dbNode["db_node_id"] = *r.Id // maintain legacy vanity id
144144
}
145145

146-
// @CODEGEN not present in schema
147146
if r.SoftwareStorageSizeInGB != nil {
148147
dbNode["software_storage_size_in_gb"] = *r.SoftwareStorageSizeInGB
149148
}

oci/dns_steering_policy_resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ func SteeringPolicyRuleToMap(obj oci_dns.SteeringPolicyRule) map[string]interfac
10911091
log.Printf("[WARN] Received 'rule_type' of unknown type %v", obj)
10921092
return nil
10931093
}
1094+
10941095
return result
10951096
}
10961097

oci/dns_zone_resource.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ func (s *DnsZoneResourceCrud) Delete() error {
335335
request.ZoneNameOrId = &tmp
336336

337337
request.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "dns")
338+
338339
_, err := s.Client.DeleteZone(context.Background(), request)
339340
return err
340341
}
@@ -376,16 +377,18 @@ func (s *DnsZoneResourceCrud) SetData() error {
376377
s.D.Set("serial", *s.Res.Serial)
377378
}
378379

380+
s.D.Set("state", s.Res.LifecycleState)
381+
382+
if s.Res.TimeCreated != nil {
383+
s.D.Set("time_created", s.Res.TimeCreated.String())
384+
}
385+
379386
if s.Res.Version != nil {
380387
s.D.Set("version", *s.Res.Version)
381388
}
382389

383390
s.D.Set("zone_type", s.Res.ZoneType)
384391

385-
s.D.Set("state", s.Res.LifecycleState)
386-
387-
s.D.Set("time_created", s.Res.TimeCreated.String())
388-
389392
return nil
390393
}
391394

oci/dns_zones_data_source.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ func DnsZonesDataSource() *schema.Resource {
1616
Read: readDnsZones,
1717
Schema: map[string]*schema.Schema{
1818
"filter": dataSourceFiltersSchema(),
19-
20-
// Required
2119
"compartment_id": {
2220
Type: schema.TypeString,
2321
Required: true,
2422
},
25-
26-
// Optional
2723
"name": {
2824
Type: schema.TypeString,
2925
Optional: true,
@@ -56,8 +52,6 @@ func DnsZonesDataSource() *schema.Resource {
5652
Type: schema.TypeString,
5753
Optional: true,
5854
},
59-
60-
// Computed
6155
"zones": {
6256
Type: schema.TypeList,
6357
Computed: true,
@@ -195,7 +189,11 @@ func (s *DnsZonesDataSourceCrud) SetData() error {
195189
zone["serial"] = *r.Serial
196190
}
197191

198-
zone["time_created"] = r.TimeCreated.String()
192+
zone["state"] = r.LifecycleState
193+
194+
if r.TimeCreated != nil {
195+
zone["time_created"] = r.TimeCreated.String()
196+
}
199197

200198
if r.Version != nil {
201199
zone["version"] = *r.Version

oci/health_checks_http_monitor_resource.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ func (s *HealthChecksHttpMonitorResourceCrud) Update() error {
306306
request.Method = oci_health_checks.UpdateHttpMonitorDetailsMethodEnum(method.(string))
307307
}
308308

309+
tmp := s.D.Id()
310+
request.MonitorId = &tmp
311+
309312
if path, ok := s.D.GetOkExists("path"); ok {
310313
tmp := path.(string)
311314
request.Path = &tmp
@@ -349,9 +352,6 @@ func (s *HealthChecksHttpMonitorResourceCrud) Update() error {
349352
request.VantagePointNames = tmp
350353
}
351354

352-
tmp := s.D.Id()
353-
request.MonitorId = &tmp
354-
355355
request.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "health_checks")
356356

357357
response, err := s.Client.UpdateHttpMonitor(context.Background(), request)

0 commit comments

Comments
 (0)