mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
This commit is contained in:
committed by
Craig Peterson
parent
e1af3034c7
commit
9d0f9a1531
@ -368,7 +368,7 @@ type cfRecord struct {
|
|||||||
CreatedOn time.Time `json:"created_on"`
|
CreatedOn time.Time `json:"created_on"`
|
||||||
ModifiedOn time.Time `json:"modified_on"`
|
ModifiedOn time.Time `json:"modified_on"`
|
||||||
Data *cfRecData `json:"data"`
|
Data *cfRecData `json:"data"`
|
||||||
Priority uint16 `json:"priority"`
|
Priority json.Number `json:"priority"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *cfRecord) nativeToRecord(domain string) *models.RecordConfig {
|
func (c *cfRecord) nativeToRecord(domain string) *models.RecordConfig {
|
||||||
@ -384,7 +384,13 @@ func (c *cfRecord) nativeToRecord(domain string) *models.RecordConfig {
|
|||||||
rc.SetLabelFromFQDN(c.Name, domain)
|
rc.SetLabelFromFQDN(c.Name, domain)
|
||||||
switch rType := c.Type; rType { // #rtype_variations
|
switch rType := c.Type; rType { // #rtype_variations
|
||||||
case "MX":
|
case "MX":
|
||||||
if err := rc.SetTargetMX(c.Priority, c.Content); err != nil {
|
var priority uint16
|
||||||
|
if p, err := c.Priority.Int64(); err != nil {
|
||||||
|
panic(errors.Wrap(err, "error decoding priority from cloudflare record"))
|
||||||
|
} else {
|
||||||
|
priority = uint16(p)
|
||||||
|
}
|
||||||
|
if err := rc.SetTargetMX(priority, c.Content); err != nil {
|
||||||
panic(errors.Wrap(err, "unparsable MX record received from cloudflare"))
|
panic(errors.Wrap(err, "unparsable MX record received from cloudflare"))
|
||||||
}
|
}
|
||||||
case "SRV":
|
case "SRV":
|
||||||
|
Reference in New Issue
Block a user