mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CLOUDNS: fix two integration test failed (#2246)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
@@ -21,5 +21,7 @@ func AuditRecords(records []*models.RecordConfig) []error {
|
|||||||
|
|
||||||
a.Add("TXT", rejectif.TxtHasMultipleSegments) // Last verified 2021-03-01
|
a.Add("TXT", rejectif.TxtHasMultipleSegments) // Last verified 2021-03-01
|
||||||
|
|
||||||
|
a.Add("SRV", rejectif.SrvHasNullTarget) // Last verified 2023-03-30
|
||||||
|
|
||||||
return a.Audit(records)
|
return a.Audit(records)
|
||||||
}
|
}
|
||||||
|
@@ -136,7 +136,11 @@ func (c *cloudnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var createCorrections []*models.Correction
|
var (
|
||||||
|
createCorrections []*models.Correction
|
||||||
|
createARecordCorrections []*models.Correction
|
||||||
|
createNSRecordCorrections []*models.Correction
|
||||||
|
)
|
||||||
for _, m := range create {
|
for _, m := range create {
|
||||||
req, err := toReq(m.Desired)
|
req, err := toReq(m.Desired)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -155,15 +159,20 @@ func (c *cloudnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
|||||||
return c.createRecord(domainID, req)
|
return c.createRecord(domainID, req)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// at ClouDNS, we MUST have a NS for a DS
|
// A & AAAA need to be created before NS #2244
|
||||||
// So, when creating, we must create the NS first, otherwise creating the DS throws an error
|
// NS need to be created before DS #1018
|
||||||
if m.Desired.Type == "NS" {
|
// or else errors will be thrown
|
||||||
// type NS is prepended - so executed first
|
switch m.Desired.Type {
|
||||||
createCorrections = append([]*models.Correction{corr}, createCorrections...)
|
case "A", "AAAA":
|
||||||
} else {
|
createARecordCorrections = append(createARecordCorrections, corr)
|
||||||
|
case "NS":
|
||||||
|
createNSRecordCorrections = append(createNSRecordCorrections, corr)
|
||||||
|
default:
|
||||||
createCorrections = append(createCorrections, corr)
|
createCorrections = append(createCorrections, corr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
corrections = append(corrections, createARecordCorrections...)
|
||||||
|
corrections = append(corrections, createNSRecordCorrections...)
|
||||||
corrections = append(corrections, createCorrections...)
|
corrections = append(corrections, createCorrections...)
|
||||||
|
|
||||||
for _, m := range modify {
|
for _, m := range modify {
|
||||||
|
Reference in New Issue
Block a user