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

all converted

This commit is contained in:
Tom Limoncelli
2023-03-09 08:18:37 -08:00
parent 18e2814a5a
commit 7339402d25
5 changed files with 45 additions and 12 deletions

View File

@ -70,13 +70,20 @@ func (s *softlayerProvider) GetZoneRecords(domain string) (models.Records, error
func (s *softlayerProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
domain, err := s.getDomain(&dc.Name)
if err != nil {
return nil, err
}
actual, err := s.getExistingRecords(domain)
if err != nil {
return nil, err
}
return s.GetZoneRecordsCorrections(dc, actual)
}
func (s *softlayerProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, actual models.Records) ([]*models.Correction, error) {
domain, err := s.getDomain(&dc.Name)
if err != nil {
return nil, err
}
@ -119,6 +126,8 @@ func (s *softlayerProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mo
}
func (s *softlayerProvider) getDomain(name *string) (*datatypes.Dns_Domain, error) {
// FIXME(tlim) Memoize this
domains, err := services.GetAccountService(s.Session).
Filter(filter.Path("domains.name").Eq(name).Build()).
Mask("resourceRecords").