Skip to content

Commit

Permalink
add retry on resource read for dns.ResourceRecordSetsListResponse (#4769
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bjorand authored and nat-henderson committed Dec 6, 2019
1 parent a380e6b commit c25a51d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions google/resource_dns_record_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ func resourceDnsRecordSetRead(d *schema.ResourceData, meta interface{}) error {
name := d.Get("name").(string)
dnsType := d.Get("type").(string)

resp, err := config.clientDns.ResourceRecordSets.List(
project, zone).Name(name).Type(dnsType).Do()
var resp *dns.ResourceRecordSetsListResponse
err = retry(func() error {
var reqErr error
resp, reqErr = config.clientDns.ResourceRecordSets.List(
project, zone).Name(name).Type(dnsType).Do()
return reqErr
})
if err != nil {
return handleNotFoundError(err, d, fmt.Sprintf("DNS Record Set %q", d.Get("name").(string)))
}
Expand Down

0 comments on commit c25a51d

Please sign in to comment.