mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 09:43:17 -04:00
fix: clouddns plugin answers limited to one response (#5986)
* inserts all records in the loop. checks for insert errors. adds test. fixes #5985 Signed-off-by: Marcos Mendez <marcos_mendez@homedepot.com>
This commit is contained in:
@@ -161,16 +161,18 @@ func updateZoneFromRRS(rrs *gcp.ResourceRecordSetsListResponse, z *file.Zone) er
|
||||
if rr.Type == "CNAME" || rr.Type == "PTR" {
|
||||
value = dns.Fqdn(value)
|
||||
}
|
||||
|
||||
// Assemble RFC 1035 conforming record to pass into dns scanner.
|
||||
rfc1035 = fmt.Sprintf("%s %d IN %s %s", dns.Fqdn(rr.Name), rr.Ttl, rr.Type, value)
|
||||
r, err = dns.NewRR(rfc1035)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse resource record: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
z.Insert(r)
|
||||
err = z.Insert(r)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to insert record: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user