Skip to content

Commit f38e12c

Browse files
REFACTOR: Remove dead code, fix comments (#4057)
Co-authored-by: Matteo Contrini <[email protected]>
1 parent 24d3680 commit f38e12c

17 files changed

Lines changed: 10 additions & 298 deletions

File tree

pkg/diff2/groupsort.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

pkg/providers/providers.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,6 @@ func (n None) GetZoneRecordsCorrections(dc *models.DomainConfig, records models.
193193
return nil, 0, nil
194194
}
195195

196-
// GetDomainCorrections returns corrections to update a domain.
197-
func (n None) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
198-
return nil, nil
199-
}
200-
201196
var featuresNone = DocumentationNotes{
202197
// The default for unlisted capabilities is 'Cannot'.
203198
// See providers/capabilities.go for the entire list of capabilities.

pkg/txtutil/txtcombined.go

Lines changed: 0 additions & 53 deletions
This file was deleted.

providers/cloudns/cloudnsProvider.go

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -96,43 +96,6 @@ func (c *cloudnsProvider) GetNameservers(domain string) ([]*models.Nameserver, e
9696
return models.ToNameservers(names)
9797
}
9898

99-
// // GetDomainCorrections returns the corrections for a domain.
100-
// func (c *cloudnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
101-
// dc, err := dc.Copy()
102-
// if err != nil {
103-
// return nil, err
104-
// }
105-
106-
// dc.Punycode()
107-
108-
// if c.domainIndex == nil {
109-
// if err := c.fetchDomainList(); err != nil {
110-
// return nil, err
111-
// }
112-
// }
113-
// _, ok := c.domainIndex[dc.Name]
114-
// if !ok {
115-
// return nil, fmt.Errorf("'%s' not a zone in ClouDNS account", dc.Name)
116-
// }
117-
118-
// existingRecords, err := c.GetZoneRecords(dc.Name)
119-
// if err != nil {
120-
// return nil, err
121-
// }
122-
// // Normalize
123-
// models.PostProcessRecords(existingRecords)
124-
125-
// // Get a list of available TTL values.
126-
// // The TTL list needs to be obtained for each domain, so get it first here.
127-
// c.fetchAvailableTTLValues(dc.Name)
128-
// // ClouDNS can only be specified from a specific TTL list, so change the TTL in advance.
129-
// for _, record := range dc.Records {
130-
// record.TTL = fixTTL(record.TTL)
131-
// }
132-
133-
// return c.GetZoneRecordsCorrections(dc, existingRecords)
134-
// }
135-
13699
// GetZoneRecordsCorrections returns a list of corrections that will turn existing records into dc.Records.
137100
func (c *cloudnsProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, int, error) {
138101
domainID, ok, err := c.idForDomain(dc.Name)

providers/cnr/nameservers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (n *Client) getNameserversRaw(domain string) ([]string, error) {
6161
return ns, nil
6262
}
6363

64-
// GetRegistrarCorrections gathers corrections that would being n to match dc.
64+
// GetRegistrarCorrections gathers corrections that would bring n to match dc.
6565
func (n *Client) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
6666
nss, err := n.getNameserversRaw(dc.Name)
6767
if err != nil {

providers/cscglobal/registrar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/StackExchange/dnscontrol/v4/models"
1010
)
1111

12-
// GetRegistrarCorrections gathers corrections that would being n to match dc.
12+
// GetRegistrarCorrections gathers corrections that would bring n to match dc.
1313
func (client *providerClient) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
1414
nss, err := client.getNameservers(dc.Name)
1515
if err != nil {

providers/desec/desecProvider.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,6 @@ func (c *desecProvider) GetNameservers(domain string) ([]*models.Nameserver, err
7777
return models.ToNameservers(defaultNameServerNames)
7878
}
7979

80-
// func (c *desecProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
81-
// if dc.AutoDNSSEC == "off" {
82-
// printer.Printf("Notice: DNSSEC signing was not requested, but cannot be turned off. (deSEC always signs all records.)\n")
83-
// }
84-
85-
// existing, err := c.GetZoneRecords(dc.Name)
86-
// if err != nil {
87-
// return nil, err
88-
// }
89-
// models.PostProcessRecords(existing)
90-
// clean := PrepFoundRecords(existing)
91-
// var minTTL uint32
92-
// c.mutex.Lock()
93-
// if ttl, ok := c.domainIndex[dc.Name]; !ok {
94-
// minTTL = 3600
95-
// } else {
96-
// minTTL = ttl
97-
// }
98-
// c.mutex.Unlock()
99-
// PrepDesiredRecords(dc, minTTL)
100-
// return c.GetZoneRecordsCorrections(dc, clean)
101-
// }
102-
10380
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
10481
func (c *desecProvider) GetZoneRecords(domain string, meta map[string]string) (models.Records, error) {
10582
punycodeDomain, err := idna.ToASCII(domain)

providers/dnsimple/dnsimpleProvider.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ func (c *dnsimpleProvider) GetRegistrarCorrections(dc *models.DomainConfig) ([]*
235235
return nil, err
236236
}
237237
sort.Strings(nameServers)
238-
239238
actual := strings.Join(nameServers, ",")
240239

241240
var expectedSet []string

providers/dnsmadeeasy/dnsMadeEasyProvider.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -68,42 +68,6 @@ func New(settings map[string]string, _ json.RawMessage) (providers.DNSServicePro
6868
return api, nil
6969
}
7070

71-
// // GetDomainCorrections returns the corrections for a domain.
72-
// func (api *dnsMadeEasyProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
73-
// dc, err := dc.Copy()
74-
// if err != nil {
75-
// return nil, err
76-
// }
77-
78-
// err = dc.Punycode()
79-
// if err != nil {
80-
// return nil, err
81-
// }
82-
83-
// for _, rec := range dc.Records {
84-
// if rec.Type == "ALIAS" {
85-
// // ALIAS is called ANAME on DNS Made Easy
86-
// rec.Type = "ANAME"
87-
// } else if rec.Type == "NS" {
88-
// // NS records have fixed TTL on DNS Made Easy and it cannot be changed
89-
// rec.TTL = fixedNameServerRecordTTL
90-
// }
91-
// }
92-
93-
// domainName := dc.Name
94-
95-
// // Get existing records
96-
// existingRecords, err := api.GetZoneRecords(domainName)
97-
// if err != nil {
98-
// return nil, err
99-
// }
100-
101-
// // Normalize
102-
// models.PostProcessRecords(existingRecords)
103-
104-
// return api.GetZoneRecordsCorrections(dc, existingRecords)
105-
// }
106-
10771
func (api *dnsMadeEasyProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, int, error) {
10872
domainName := dc.Name
10973
domainID, err := api.findDomainID(domainName)

providers/doh/dohProvider.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func newDNSOverHTTPS(m map[string]string) (providers.Registrar, error) {
4040
return api, nil
4141
}
4242

43-
// GetRegistrarCorrections gathers corrections that would being n to match dc.
43+
// GetRegistrarCorrections gathers corrections that would bring n to match dc.
4444
func (c *dohProvider) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error) {
4545
nss, err := c.getNameservers(dc.Name)
4646
if err != nil {
@@ -58,7 +58,6 @@ func (c *dohProvider) GetRegistrarCorrections(dc *models.DomainConfig) ([]*model
5858
if foundNameservers == expectedNameservers {
5959
return nil, nil
6060
}
61-
6261
return []*models.Correction{
6362
{
6463
Msg: fmt.Sprintf("Update nameservers %s -> %s", foundNameservers, expectedNameservers),

0 commit comments

Comments
 (0)