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

HEXONET: Adopt diff2 in compatibility mode (#1889)

This commit is contained in:
Tom Limoncelli
2023-01-30 12:44:37 -05:00
committed by GitHub
parent 39f0bf6009
commit f5e6564318

View File

@ -75,16 +75,18 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
txtutil.SplitSingleLongTxt(dc.Records)
var corrections []*models.Correction
if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
var create, del, mod diff.Changeset
if !diff2.EnableDiff2 {
differ := diff.New(dc)
_, create, del, mod, err := differ.IncrementalDiff(actual)
_, create, del, mod, err = differ.IncrementalDiff(actual)
} else {
differ := diff.NewCompat(dc)
_, create, del, mod, err = differ.IncrementalDiff(actual)
}
if err != nil {
return nil, err
}
corrections := []*models.Correction{}
buf := &bytes.Buffer{}
// Print a list of changes. Generate an actual change that is the zone
changes := false
@ -133,10 +135,6 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
},
})
}
return corrections, nil
}
// Insert Future diff2 version here.
return corrections, nil
}