1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

BUG: Some DNS zones are downloaded twice (#2120)

Signed-off-by: Amelia Aronsohn <squirrel@wearing.black>
Co-authored-by: Tom Limoncelli <tal@whatexit.org>
Co-authored-by: Grégoire Henry <hnrgrgr@users.noreply.github.com>
Co-authored-by: Amelia Aronsohn <squirrel@wearing.black>
Co-authored-by: Kai Schwarz <kschwarz@hexonet.net>
Co-authored-by: Asif Nawaz <asif.nawaz@centralnic.com>
Co-authored-by: imlonghao <git@imlonghao.com>
Co-authored-by: Will Power <1619102+willpower232@users.noreply.github.com>
This commit is contained in:
Tom Limoncelli
2023-04-14 15:22:23 -04:00
committed by GitHub
parent 61559f6a96
commit 60470a3886
56 changed files with 994 additions and 1186 deletions

View File

@@ -34,14 +34,10 @@ func (n *namedotcomProvider) GetZoneRecords(domain string) (models.Records, erro
return actual, nil
}
// GetDomainCorrections gathers correctios that would bring n to match dc.
func (n *namedotcomProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
dc.Punycode()
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
func (n *namedotcomProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, actual models.Records) ([]*models.Correction, error) {
actual, err := n.GetZoneRecords(dc.Name)
if err != nil {
return nil, err
}
checkNSModifications(dc)
for _, rec := range dc.Records {
if rec.Type == "ALIAS" {
@@ -49,11 +45,6 @@ func (n *namedotcomProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*m
}
}
checkNSModifications(dc)
// Normalize
models.PostProcessRecords(actual)
var corrections []*models.Correction
var differ diff.Differ
if !diff2.EnableDiff2 {
@@ -193,19 +184,6 @@ func (n *namedotcomProvider) createRecord(rc *models.RecordConfig, domain string
return err
}
// // makeTxt encodes TxtStrings for sending in the CREATE/MODIFY API:
// func encodeTxt(txts []string) string {
// ans := txts[0]
// if len(txts) > 1 {
// ans = ""
// for _, t := range txts {
// ans += `"` + strings.Replace(t, `"`, `\"`, -1) + `"`
// }
// }
// return ans
// }
// finds a string surrounded by quotes that might contain an escaped quote character.
var quotedStringRegexp = regexp.MustCompile(`"((?:[^"\\]|\\.)*)"`)