Skip to content

Commit

Permalink
NETLIFY: add support for listing all zones (#2933)
Browse files Browse the repository at this point in the history
Signed-off-by: SphericalKat <amolele@gmail.com>
  • Loading branch information
SphericalKat committed May 3, 2024
1 parent 4757a0f commit 1616348
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions providers/netlify/netlifyProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1616348

Please sign in to comment.