mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Remove txtutil.SplitSingleLongTxt
This commit is contained in:
@ -1,23 +1,5 @@
|
|||||||
package txtutil
|
package txtutil
|
||||||
|
|
||||||
import "github.com/StackExchange/dnscontrol/v4/models"
|
|
||||||
|
|
||||||
// SplitSingleLongTxt finds TXT records with a single long string and splits it
|
|
||||||
// into 255-octet chunks. This is used by providers that, when a user specifies
|
|
||||||
// one long TXT string, split it into smaller strings behind the scenes.
|
|
||||||
// This should be called from GetZoneRecordsCorrections().
|
|
||||||
// Deprecated: SplitSingleLongTxt() is deprecated. No longer needed.
|
|
||||||
func SplitSingleLongTxt(records []*models.RecordConfig) {
|
|
||||||
// for _, rc := range records {
|
|
||||||
// if rc.HasFormatIdenticalToTXT() {
|
|
||||||
// s := rc.TxtStrings[0]
|
|
||||||
// if len(rc.TxtStrings) == 1 && len(s) > 255 {
|
|
||||||
// rc.SetTargetTXTs(splitChunks(s, 255))
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
// ToChunks returns the string as chunks of 255-octet strings (the last string being the remainder).
|
// ToChunks returns the string as chunks of 255-octet strings (the last string being the remainder).
|
||||||
func ToChunks(s string) []string {
|
func ToChunks(s string) []string {
|
||||||
return splitChunks(s, 255)
|
return splitChunks(s, 255)
|
||||||
|
@ -17,7 +17,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -106,7 +105,6 @@ func (a *edgeDNSProvider) EnsureZoneExists(domain string) error {
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (a *edgeDNSProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (a *edgeDNSProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(existingRecords)
|
|
||||||
|
|
||||||
keysToUpdate, toReport, err := diff.NewCompat(dc).ChangedGroups(existingRecords)
|
keysToUpdate, toReport, err := diff.NewCompat(dc).ChangedGroups(existingRecords)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -11,7 +11,6 @@ import (
|
|||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -68,7 +67,6 @@ func New(settings map[string]string, _ json.RawMessage) (providers.DNSServicePro
|
|||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (api *autoDNSProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (api *autoDNSProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
domain := dc.Name
|
domain := dc.Name
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
var corrections []*models.Correction
|
var corrections []*models.Correction
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
@ -409,7 +408,6 @@ func hasNSDeletion(changes diff2.ChangeList) bool {
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (c *axfrddnsProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, foundRecords models.Records) ([]*models.Correction, error) {
|
func (c *axfrddnsProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, foundRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(foundRecords) // Autosplit long TXT records
|
|
||||||
|
|
||||||
// Ignoring the SOA, others providers don't manage it either.
|
// Ignoring the SOA, others providers don't manage it either.
|
||||||
if len(foundRecords) >= 1 && foundRecords[0].Type == "SOA" {
|
if len(foundRecords) >= 1 && foundRecords[0].Type == "SOA" {
|
||||||
|
@ -14,7 +14,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -193,8 +192,6 @@ func (a *azurednsProvider) getExistingRecords(domain string) (models.Records, []
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (a *azurednsProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (a *azurednsProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(existingRecords) // Autosplit long TXT records
|
|
||||||
|
|
||||||
var corrections []*models.Correction
|
var corrections []*models.Correction
|
||||||
|
|
||||||
// Azure is a "ByRecordSet" API.
|
// Azure is a "ByRecordSet" API.
|
||||||
|
@ -25,7 +25,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/prettyzone"
|
"github.com/StackExchange/dnscontrol/v4/pkg/prettyzone"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
)
|
)
|
||||||
@ -210,7 +209,6 @@ func ParseZoneContents(content string, zoneName string, zonefileName string) (mo
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (c *bindProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, foundRecords models.Records) ([]*models.Correction, error) {
|
func (c *bindProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, foundRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records)
|
|
||||||
var corrections []*models.Correction
|
var corrections []*models.Correction
|
||||||
|
|
||||||
changes := false
|
changes := false
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/miekg/dns/dnsutil"
|
"github.com/miekg/dns/dnsutil"
|
||||||
)
|
)
|
||||||
@ -151,8 +150,6 @@ func PrepDesiredRecords(dc *models.DomainConfig, minTTL uint32) {
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (c *desecProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existing models.Records) ([]*models.Correction, error) {
|
func (c *desecProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existing models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records)
|
|
||||||
|
|
||||||
var minTTL uint32
|
var minTTL uint32
|
||||||
c.mutex.Lock()
|
c.mutex.Lock()
|
||||||
if ttl, ok := c.domainIndex[dc.Name]; !ok {
|
if ttl, ok := c.domainIndex[dc.Name]; !ok {
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/digitalocean/godo"
|
"github.com/digitalocean/godo"
|
||||||
"github.com/miekg/dns/dnsutil"
|
"github.com/miekg/dns/dnsutil"
|
||||||
@ -168,8 +167,6 @@ func (api *digitaloceanProvider) GetZoneRecords(domain string, meta map[string]s
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (api *digitaloceanProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (api *digitaloceanProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
toReport, toCreate, toDelete, toModify, err := diff.NewCompat(dc).IncrementalDiff(existingRecords)
|
toReport, toCreate, toDelete, toModify, err := diff.NewCompat(dc).IncrementalDiff(existingRecords)
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -99,8 +98,6 @@ func New(settings map[string]string, _ json.RawMessage) (providers.DNSServicePro
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
func (api *dnsMadeEasyProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (api *dnsMadeEasyProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
domainName := dc.Name
|
domainName := dc.Name
|
||||||
domain, err := api.findDomain(domainName)
|
domain, err := api.findDomain(domainName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -24,7 +24,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/go-gandi/go-gandi"
|
"github.com/go-gandi/go-gandi"
|
||||||
"github.com/go-gandi/go-gandi/config"
|
"github.com/go-gandi/go-gandi/config"
|
||||||
@ -198,7 +197,6 @@ func (client *gandiv5Provider) GetZoneRecordsCorrections(dc *models.DomainConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
PrepDesiredRecords(dc)
|
PrepDesiredRecords(dc)
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
g := gandi.NewLiveDNSClient(config.Config{
|
g := gandi.NewLiveDNSClient(config.Config{
|
||||||
APIKey: client.apikey,
|
APIKey: client.apikey,
|
||||||
|
@ -12,7 +12,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
gauth "golang.org/x/oauth2/google"
|
gauth "golang.org/x/oauth2/google"
|
||||||
gdns "google.golang.org/api/dns/v1"
|
gdns "google.golang.org/api/dns/v1"
|
||||||
@ -259,8 +258,6 @@ type correctionValues struct {
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (g *gcloudProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (g *gcloudProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
oldRRs, ok := g.oldRRsMap[dc.Name]
|
oldRRs, ok := g.oldRRsMap[dc.Name]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("oldRRsMap: no zone named %q", dc.Name)
|
return nil, fmt.Errorf("oldRRsMap: no zone named %q", dc.Name)
|
||||||
|
@ -17,7 +17,6 @@ import (
|
|||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/pquerna/otp/totp"
|
"github.com/pquerna/otp/totp"
|
||||||
)
|
)
|
||||||
@ -191,9 +190,6 @@ func (c *hednsProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, recor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normalize
|
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
return c.getDiff2DomainCorrections(dc, zoneID, prunedRecords)
|
return c.getDiff2DomainCorrections(dc, zoneID, prunedRecords)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -72,8 +71,6 @@ func (api *hetznerProvider) EnsureZoneExists(domain string) error {
|
|||||||
func (api *hetznerProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (api *hetznerProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
domain := dc.Name
|
domain := dc.Name
|
||||||
|
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
toReport, create, del, modify, err := diff.NewCompat(dc).IncrementalDiff(existingRecords)
|
toReport, create, del, modify, err := diff.NewCompat(dc).IncrementalDiff(existingRecords)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// HXRecord covers an individual DNS resource record.
|
// HXRecord covers an individual DNS resource record.
|
||||||
@ -58,8 +57,6 @@ func (n *HXClient) GetZoneRecords(domain string, meta map[string]string) (models
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (n *HXClient) GetZoneRecordsCorrections(dc *models.DomainConfig, actual models.Records) ([]*models.Correction, error) {
|
func (n *HXClient) GetZoneRecordsCorrections(dc *models.DomainConfig, actual models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records)
|
|
||||||
|
|
||||||
toReport, create, del, mod, err := diff.NewCompat(dc).IncrementalDiff(actual)
|
toReport, create, del, mod, err := diff.NewCompat(dc).IncrementalDiff(actual)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/nrdcg/goinwx"
|
"github.com/nrdcg/goinwx"
|
||||||
"github.com/pquerna/otp/totp"
|
"github.com/pquerna/otp/totp"
|
||||||
@ -226,9 +225,6 @@ func checkRecords(records models.Records) error {
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (api *inwxAPI) GetZoneRecordsCorrections(dc *models.DomainConfig, foundRecords models.Records) ([]*models.Correction, error) {
|
func (api *inwxAPI) GetZoneRecordsCorrections(dc *models.DomainConfig, foundRecords models.Records) ([]*models.Correction, error) {
|
||||||
|
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
err := checkRecords(dc.Records)
|
err := checkRecords(dc.Records)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -25,7 +25,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/miekg/dns/dnsutil"
|
"github.com/miekg/dns/dnsutil"
|
||||||
)
|
)
|
||||||
@ -272,7 +271,6 @@ func (c *APIClient) GetZoneRecordsCorrections(dc *models.DomainConfig, existingR
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Normalize
|
// Normalize
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
PrepDesiredRecords(dc)
|
PrepDesiredRecords(dc)
|
||||||
|
|
||||||
var keysToUpdate map[models.RecordKey][]string
|
var keysToUpdate map[models.RecordKey][]string
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
@ -14,7 +13,6 @@ func (client *msdnsProvider) GetZoneRecordsCorrections(dc *models.DomainConfig,
|
|||||||
|
|
||||||
// Normalize
|
// Normalize
|
||||||
models.PostProcessRecords(foundRecords)
|
models.PostProcessRecords(foundRecords)
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
changes, err := diff2.ByRecord(foundRecords, dc, nil)
|
changes, err := diff2.ByRecord(foundRecords, dc, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/oracle/oci-go-sdk/v32/common"
|
"github.com/oracle/oci-go-sdk/v32/common"
|
||||||
"github.com/oracle/oci-go-sdk/v32/dns"
|
"github.com/oracle/oci-go-sdk/v32/dns"
|
||||||
@ -204,7 +203,6 @@ func (o *oracleProvider) GetZoneRecords(zone string, meta map[string]string) (mo
|
|||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (o *oracleProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (o *oracleProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
var err error
|
var err error
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
// Ensure we don't emit changes for attempted modification of built-in apex NSs
|
// Ensure we don't emit changes for attempted modification of built-in apex NSs
|
||||||
for _, rec := range dc.Records {
|
for _, rec := range dc.Records {
|
||||||
|
@ -14,7 +14,6 @@ import (
|
|||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"github.com/aws/aws-sdk-go-v2/aws"
|
"github.com/aws/aws-sdk-go-v2/aws"
|
||||||
"github.com/aws/aws-sdk-go-v2/config"
|
"github.com/aws/aws-sdk-go-v2/config"
|
||||||
@ -278,8 +277,6 @@ func (r *route53Provider) getZoneRecords(zone r53Types.HostedZone) (models.Recor
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (r *route53Provider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (r *route53Provider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
|
|
||||||
zone, err := r.getZone(dc)
|
zone, err := r.getZone(dc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RWTHDefaultNs is the default DNS NS for this provider.
|
// RWTHDefaultNs is the default DNS NS for this provider.
|
||||||
@ -31,7 +30,6 @@ func (api *rwthProvider) GetNameservers(domain string) ([]*models.Nameserver, er
|
|||||||
|
|
||||||
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
|
||||||
func (api *rwthProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
func (api *rwthProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, error) {
|
||||||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
|
||||||
domain := dc.Name
|
domain := dc.Name
|
||||||
|
|
||||||
toReport, create, del, modify, err := diff.NewCompat(dc).IncrementalDiff(existingRecords)
|
toReport, create, del, modify, err := diff.NewCompat(dc).IncrementalDiff(existingRecords)
|
||||||
|
Reference in New Issue
Block a user