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:
@ -75,16 +75,18 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
|
|||||||
txtutil.SplitSingleLongTxt(dc.Records)
|
txtutil.SplitSingleLongTxt(dc.Records)
|
||||||
|
|
||||||
var corrections []*models.Correction
|
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)
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
corrections := []*models.Correction{}
|
|
||||||
|
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
// Print a list of changes. Generate an actual change that is the zone
|
// Print a list of changes. Generate an actual change that is the zone
|
||||||
changes := false
|
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
|
return corrections, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user