diff --git a/providers/netlify/api.go b/providers/netlify/api.go index 70eaae389..31b700f85 100644 --- a/providers/netlify/api.go +++ b/providers/netlify/api.go @@ -48,7 +48,7 @@ type dnsRecordCreate struct { Flag int64 `json:"flag"` Hostname string `json:"hostname,omitempty"` Port int64 `json:"port,omitempty"` - Priority int64 `json:"priority,omitempty"` + Priority int64 `json:"priority"` Tag string `json:"tag,omitempty"` TTL int64 `json:"ttl,omitempty"` Type string `json:"type,omitempty"` diff --git a/providers/netlify/netlifyProvider.go b/providers/netlify/netlifyProvider.go index 42f474d03..203e3d61a 100644 --- a/providers/netlify/netlifyProvider.go +++ b/providers/netlify/netlifyProvider.go @@ -8,7 +8,6 @@ import ( "github.com/StackExchange/dnscontrol/v4/models" "github.com/StackExchange/dnscontrol/v4/pkg/diff" "github.com/StackExchange/dnscontrol/v4/pkg/diff2" - "github.com/StackExchange/dnscontrol/v4/pkg/printer" "github.com/StackExchange/dnscontrol/v4/providers" "github.com/miekg/dns" ) @@ -144,43 +143,8 @@ func (n *netlifyProvider) GetZoneRecords(domain string, meta map[string]string) return cleanRecords, nil } -// Return true if the string ends in one of Netlify's name server domains -// False if anything else -func isNetlifyNameServerDomain(name string) bool { - for _, i := range nameServerSuffixes { - if strings.HasSuffix(name, i) { - return true - } - } - return false -} - -// remove all non-netlify NS records from our desired state. -// if any are found, print a warning -func removeOtherApexNS(dc *models.DomainConfig) { - newList := make([]*models.RecordConfig, 0, len(dc.Records)) - for _, rec := range dc.Records { - if rec.Type == "NS" { - // apex NS inside netlify are expected. - // We ignore them, warning as needed. - // Child delegations are supported so, we allow non-apex NS records. - if rec.GetLabelFQDN() == dc.Name { - if !isNetlifyNameServerDomain(rec.GetTargetField()) { - printer.Printf("Warning: Netlify does not allow NS records to be modified. %s will not be added.\n", rec.GetTargetField()) - } - continue - } - } - newList = append(newList, rec) - } - dc.Records = newList -} - // 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) { - - removeOtherApexNS(dc) - var corrections []*models.Correction var differ diff.Differ if !diff2.EnableDiff2 {