SOFTLAYER: Adopt diff2 in compatibility mode
@@ -82,14 +82,17 @@ func (s *softlayerProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mo
}
var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
- _, create, delete, modify, err := diff.New(dc).IncrementalDiff(actual)
+ var create, deletes, modify diff.Changeset
+ if !diff2.EnableDiff2 {
+ _, create, deletes, modify, err = diff.New(dc).IncrementalDiff(actual)
+ } else {
+ _, create, deletes, modify, err = diff.NewCompat(dc).IncrementalDiff(actual)
+ }
if err != nil {
return nil, err
}
- for _, del := range delete {
+ for _, del := range deletes {
existing := del.Existing.Original.(datatypes.Dns_Domain_ResourceRecord)
corrections = append(corrections, &models.Correction{
Msg: del.String(),
@@ -115,11 +118,6 @@ func (s *softlayerProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mo
return corrections, nil
}
- // Insert Future diff2 version here.
-
- return corrections, nil
-}
-
func (s *softlayerProvider) getDomain(name *string) (*datatypes.Dns_Domain, error) {
domains, err := services.GetAccountService(s.Session).
Filter(filter.Path("domains.name").Eq(name).Build()).
