NETLIFY: add support for listing all zones (#2933)

Signed-off-by: SphericalKat <amolele@gmail.com>
This commit is contained in:
Amogh Lele 2024-05-03 23:20:45 +05:30 committed by GitHub
parent 4757a0feee
commit 1616348039
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,6 +141,21 @@ func (n *netlifyProvider) GetZoneRecords(domain string, meta map[string]string)
return cleanRecords, nil
}
// ListZones returns all DNS zones managed by this provider.
func (n *netlifyProvider) ListZones() ([]string, error) {
zones, err := n.getDNSZones()
if err != nil {
return nil, err
}
zoneNames := make([]string, len(zones))
for i, z := range zones {
zoneNames[i] = z.Name
}
return zoneNames, nil
}
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
func (n *netlifyProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, records models.Records) ([]*models.Correction, error) {
toReport, create, del, modify, err := diff.NewCompat(dc).IncrementalDiff(records)