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

@@ -25,15 +25,8 @@ func (api *domainNameShopProvider) GetZoneRecords(domain string) (models.Records
return existingRecords, nil
}
func (api *domainNameShopProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
dc.Punycode()
existingRecords, err := api.GetZoneRecords(dc.Name)
if err != nil {
return nil, err
}
// Normalize
models.PostProcessRecords(existingRecords)
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
func (api *domainNameShopProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
// Merge TXT strings to one string
for _, rc := range dc.Records {
@@ -48,14 +41,13 @@ func (api *domainNameShopProvider) GetDomainCorrections(dc *models.DomainConfig)
}
var corrections []*models.Correction
var create, delete, modify diff.Changeset
var differ diff.Differ
if !diff2.EnableDiff2 {
differ = diff.New(dc)
} else {
differ = diff.NewCompat(dc)
}
_, create, delete, modify, err = differ.IncrementalDiff(existingRecords)
_, create, delete, modify, err := differ.IncrementalDiff(existingRecords)
if err != nil {
return nil, err
}