Skip to content

Commit c75a9d4

Browse files
committed
DNS record fixed for DNS outage causing problems
1 parent ae4af34 commit c75a9d4

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
### Added
44
- Support resource discovery for `streaming` resources
55

6+
### Fixed
7+
- Fixed DNS outage causing problems for DNS records
8+
69
## 3.76.0 (May 19, 2020)
710

811
### Added

oci/crud_helpers.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,12 @@ func ResourceDeprecatedForAnother(deprecatedResourceName string, newResourceName
636636
return fmt.Sprintf("The '%s' resource has been deprecated. Please use '%s' instead.", deprecatedResourceName, newResourceName)
637637
}
638638

639+
func resourceNotFoundErrorMessage(resourceName string, reason string) error {
640+
// Use this function to generate an error message for any resource that is not found. The message is specially
641+
// formatted so that it is detected by the handleMissingResourceError function correctly. Do not change the message format.
642+
return fmt.Errorf("%s not found. %s \n", resourceName, reason)
643+
}
644+
639645
// GenerateDataSourceID generates an ID for the data source based on the current time stamp.
640646
func GenerateDataSourceID() string {
641647
// Important, if you don't have an ID, make one up for your datasource

oci/dns_record_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ func findItem(rc *[]oci_dns.Record, r *schema.ResourceData) (*oci_dns.Record, er
368368
}
369369
}
370370

371-
return nil, fmt.Errorf("target %s record could not be matched against data %s\nfrom set %+v", rType, rData, rc)
371+
reason := fmt.Sprintf("Target %s record could not be matched against data %s\nfrom set %+v", rType, rData, rc)
372+
return nil, resourceNotFoundErrorMessage("DNS record", reason)
372373
}
373374

374375
// Match dns service transforms of rdata

0 commit comments

Comments
 (0)