GCLOUD: Adopt diff2 in compatibility mode
@@ -205,12 +205,18 @@ func (g *gcloudProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*model
models.PostProcessRecords(existingRecords)
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
- var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
// first collect keys that have changed
- differ := diff.New(dc)
+ var differ diff.Differ
+ if !diff2.EnableDiff2 {
+ differ = diff.New(dc)
+ } else {
+ differ = diff.NewCompat(dc)
+ }
_, create, delete, modify, err := differ.IncrementalDiff(existingRecords)
+ if err != nil {
+ return nil, err
+ }
+
if err != nil {
return nil, fmt.Errorf("incdiff error: %w", err)
}
@@ -279,11 +285,7 @@ func (g *gcloudProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*model
Msg: desc,
F: runChange,
}}, nil
- }
-
- // Insert Future diff2 version here.
- return corrections, nil
}
func nativeToRecord(set *gdns.ResourceRecordSet, rec, origin string) (*models.RecordConfig, error) {
