Skip to content

Remove unused CantUseNOPURGE capability #2877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions build/generate/featureMatrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func matrixData() *FeatureMatrix {
DomainModifierDhcid = "[`DHCID`](functions/domain/DHCID.md)"
DualHost = "dual host"
CreateDomains = "create-domains"
NoPurge = "[`NO_PURGE`](functions/domain/NO_PURGE.md)"
GetZones = "get-zones"
)

Expand All @@ -114,7 +113,7 @@ func matrixData() *FeatureMatrix {
DomainModifierDhcid,
DualHost,
CreateDomains,
NoPurge,
//NoPurge,
GetZones,
},
}
Expand Down Expand Up @@ -233,17 +232,17 @@ func matrixData() *FeatureMatrix {
false,
)

// no purge is a freaky double negative
cantUseNOPURGE := providers.CantUseNOPURGE
if providerNotes[cantUseNOPURGE] != nil {
featureMap[NoPurge] = providerNotes[cantUseNOPURGE]
} else {
featureMap.SetSimple(
NoPurge,
false,
func() bool { return !providers.ProviderHasCapability(providerName, cantUseNOPURGE) },
)
}
// // no purge is a freaky double negative
// cantUseNOPURGE := providers.CantUseNOPURGE
// if providerNotes[cantUseNOPURGE] != nil {
// featureMap[NoPurge] = providerNotes[cantUseNOPURGE]
// } else {
// featureMap.SetSimple(
// NoPurge,
// false,
// func() bool { return !providers.ProviderHasCapability(providerName, cantUseNOPURGE) },
// )
// }
matrix.Providers[providerName] = featureMap
}
return matrix
Expand Down
104 changes: 52 additions & 52 deletions documentation/providers.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkg/normalize/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ func ValidateAndNormalizeConfig(config *models.DNSConfig) (errs []error) {
// be performed.
continue
}
// If NO_PURGE is in use, make sure this *isn't* a provider that *doesn't* support NO_PURGE.
if domain.KeepUnknown && providers.ProviderHasCapability(pType, providers.CantUseNOPURGE) {
errs = append(errs, fmt.Errorf("%s uses NO_PURGE which is not supported by %s(%s)", domain.Name, provider.Name, pType))
}
// // If NO_PURGE is in use, make sure this *isn't* a provider that *doesn't* support NO_PURGE.
// if domain.KeepUnknown && providers.ProviderHasCapability(pType, providers.CantUseNOPURGE) {
// errs = append(errs, fmt.Errorf("%s uses NO_PURGE which is not supported by %s(%s)", domain.Name, provider.Name, pType))
// }
}

// Normalize Nameservers.
Expand Down
1 change: 0 additions & 1 deletion providers/akamaiedgedns/akamaiEdgeDnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ var features = providers.DocumentationNotes{
providers.CanUseSRV: providers.Can(),
providers.CanUseSSHFP: providers.Can(),
providers.CanUseTLSA: providers.Can(),
providers.CantUseNOPURGE: providers.Cannot(),
providers.DocCreateDomains: providers.Can(),
providers.DocDualHost: providers.Can(),
providers.DocOfficiallySupported: providers.Cannot(),
Expand Down
2 changes: 2 additions & 0 deletions providers/autodns/autoDnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
)

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
providers.CanUseCAA: providers.Can(),
Expand Down
5 changes: 3 additions & 2 deletions providers/axfrddns/axfrddnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ const (
)

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Can("Just warn when DNSSEC is requested but no RRSIG is found in the AXFR or warn when DNSSEC is not requested but RRSIG are found in the AXFR."),
providers.CanGetZones: providers.Cannot(),
providers.CanUseCAA: providers.Can(),
providers.CanUseDHCID: providers.Can(),
providers.CanUseLOC: providers.Unimplemented(),
providers.CanUseNAPTR: providers.Can(),
providers.CanUsePTR: providers.Can(),
providers.CanUseSRV: providers.Can(),
providers.CanUseSSHFP: providers.Can(),
providers.CanUseTLSA: providers.Can(),
providers.CanUseDHCID: providers.Can(),
providers.CantUseNOPURGE: providers.Cannot(),
providers.DocCreateDomains: providers.Cannot(),
providers.DocDualHost: providers.Cannot(),
providers.DocOfficiallySupported: providers.Cannot(),
Expand Down
2 changes: 2 additions & 0 deletions providers/azuredns/azureDnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func newAzureDNS(m map[string]string, metadata json.RawMessage) (*azurednsProvid
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Cannot("Azure DNS does not provide a generic ALIAS functionality. Use AZURE_ALIAS instead."),
providers.CanUseAzureAlias: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/azureprivatedns/azurePrivateDnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func newAzureDNS(m map[string]string, _ json.RawMessage) (*azurednsProvider, err
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Cannot("Azure DNS does not provide a generic ALIAS functionality. Use AZURE_ALIAS instead."),
providers.CanUseAzureAlias: providers.Can(),
Expand Down
3 changes: 2 additions & 1 deletion providers/bind/bindProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
)

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Can("Just writes out a comment indicating DNSSEC was requested"),
providers.CanGetZones: providers.Can(),
providers.CanUseCAA: providers.Can(),
Expand All @@ -42,7 +44,6 @@ var features = providers.DocumentationNotes{
providers.CanUseSRV: providers.Can(),
providers.CanUseSSHFP: providers.Can(),
providers.CanUseTLSA: providers.Can(),
providers.CantUseNOPURGE: providers.Cannot(),
providers.DocCreateDomains: providers.Can("Driver just maintains list of zone files. It should automatically add missing ones."),
providers.DocDualHost: providers.Can(),
providers.DocOfficiallySupported: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/bunnydns/bunnydnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Cannot(),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Cannot(),
Expand Down
6 changes: 0 additions & 6 deletions providers/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ const (
// CanUseTLSA indicates the provider can handle TLSA records
CanUseTLSA

// CantUseNOPURGE indicates NO_PURGE is broken for this provider. To make it
// work would require complex emulation of an incremental update mechanism,
// so it is easier to simply mark this feature as not working for this
// provider.
CantUseNOPURGE

// DocCreateDomains means provider can add domains with the `dnscontrol create-domains` command
DocCreateDomains

Expand Down
11 changes: 5 additions & 6 deletions providers/capability_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions providers/cloudflare/cloudflareProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Domain level metadata available:
*/

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can("CF automatically flattens CNAME records into A records dynamically"),
providers.CanUseCAA: providers.Can(),
Expand Down
3 changes: 2 additions & 1 deletion providers/cloudns/cloudnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ func NewCloudns(m map[string]string, metadata json.RawMessage) (providers.DNSSer
}

var features = providers.DocumentationNotes{
//providers.CanUseDS: providers.Can(), // in ClouDNS we can add DS record just for a subdomain(child)
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
providers.CanUseCAA: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/cscglobal/cscglobalProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type providerClient struct {
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseCAA: providers.Can(),
providers.CanUseSRV: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/desec/desecProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func NewDeSec(m map[string]string, metadata json.RawMessage) (providers.DNSServi
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Can("deSEC always signs all records. When trying to disable, a notice is printed."),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Unimplemented("Apex aliasing is supported via new SVCB and HTTPS record types. For details, check the deSEC docs."),
Expand Down
2 changes: 2 additions & 0 deletions providers/digitalocean/digitaloceanProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ retry:
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseCAA: providers.Can(),
providers.CanUseLOC: providers.Cannot(),
Expand Down
2 changes: 2 additions & 0 deletions providers/dnsimple/dnsimpleProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
)

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Can(),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/dnsmadeeasy/dnsMadeEasyProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
)

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
providers.CanUseCAA: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/domainnameshop/domainnameshopProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ type domainNameShopProvider struct {
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Cannot(), // Maybe there is support for it
providers.CanGetZones: providers.Unimplemented(), //
providers.CanUseAlias: providers.Unimplemented("Needs custom implementation"), // Can possibly be implemented, needs further research
Expand Down
2 changes: 2 additions & 0 deletions providers/exoscale/exoscaleProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func NewExoscale(m map[string]string, metadata json.RawMessage) (providers.DNSSe
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Unimplemented(),
providers.CanUseAlias: providers.Can(),
providers.CanUseCAA: providers.Can(),
Expand Down
3 changes: 2 additions & 1 deletion providers/gandiv5/gandi_v5Provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ func init() {

// features declares which features and options are available.
var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can("Only on the bare domain. Otherwise CNAME will be substituted"),
providers.CanUseCAA: providers.Can(),
Expand All @@ -54,7 +56,6 @@ var features = providers.DocumentationNotes{
providers.CanUseSRV: providers.Can(),
providers.CanUseSSHFP: providers.Can(),
providers.CanUseTLSA: providers.Can(),
providers.CantUseNOPURGE: providers.Cannot(),
providers.DocCreateDomains: providers.Cannot("Can only manage domains registered through their service"),
providers.DocOfficiallySupported: providers.Cannot(),
}
Expand Down
2 changes: 2 additions & 0 deletions providers/gcloud/gcloudProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
const selfLinkBasePath = "https://www.googleapis.com/compute/v1/projects/"

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
providers.CanUseCAA: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/gcore/gcoreProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func NewGCore(m map[string]string, metadata json.RawMessage) (providers.DNSServi
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Cannot(),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/hedns/hednsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Additionally
*/

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Cannot(),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/hetzner/hetznerProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
)

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Cannot(),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Cannot(),
Expand Down
3 changes: 2 additions & 1 deletion providers/hexonet/hexonetProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ type HXClient struct {
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Unimplemented(),
providers.CanUseAlias: providers.Cannot("Using ALIAS is possible through our extended DNS (X-DNS) service. Feel free to get in touch with us."),
providers.CanUseCAA: providers.Can(),
providers.CanUseLOC: providers.Unimplemented(),
providers.CanUsePTR: providers.Can(),
providers.CanUseSRV: providers.Can("SRV records with empty targets are not supported"),
providers.CanUseTLSA: providers.Can(),
providers.CantUseNOPURGE: providers.Can(),
providers.DocCreateDomains: providers.Can(),
providers.DocDualHost: providers.Can(),
providers.DocOfficiallySupported: providers.Cannot("Actively maintained provider module."),
Expand Down
2 changes: 2 additions & 0 deletions providers/hostingde/hostingdeProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
var defaultNameservers = []string{"ns1.hosting.de", "ns2.hosting.de", "ns3.hosting.de"}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Can(),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/inwx/inwxProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ var InwxSandboxDefaultNs = []string{"ns.ote.inwx.de", "ns2.ote.inwx.de"}

// features is used to let dnscontrol know which features are supported by INWX.
var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Unimplemented("Supported by INWX but not implemented yet."),
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Cannot("INWX does not support the ALIAS or ANAME record type."),
Expand Down
2 changes: 2 additions & 0 deletions providers/linode/linodeProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ func NewLinode(m map[string]string, metadata json.RawMessage) (providers.DNSServ
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseCAA: providers.Can("Linode doesn't support changing the CAA flag"),
providers.CanUseLOC: providers.Cannot(),
Expand Down
2 changes: 2 additions & 0 deletions providers/loopia/loopiaProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func init() {

// features declares which features and options are available.
var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanAutoDNSSEC: providers.Cannot(),
providers.CanGetZones: providers.Can(),
providers.CanUseAKAMAICDN: providers.Cannot(),
Expand Down
2 changes: 2 additions & 0 deletions providers/luadns/luadnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Info required in `creds.json`:
*/

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Can(),
providers.CanUseCAA: providers.Can(),
Expand Down
2 changes: 2 additions & 0 deletions providers/msdns/msdnsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type msdnsProvider struct {
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Cannot(),
providers.CanUseCAA: providers.Cannot(),
Expand Down
4 changes: 3 additions & 1 deletion providers/mythicbeasts/mythicbeastsProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ type mythicBeastsProvider struct {
}

var features = providers.DocumentationNotes{
// The default for unlisted capabilities is 'Cannot'.
// See providers/capabilities.go for the entire list of capabilities.
providers.CanGetZones: providers.Can(),
providers.CanUseAlias: providers.Cannot(),
providers.CanUseCAA: providers.Can(),
providers.CanUseLOC: providers.Cannot(),
providers.CanUsePTR: providers.Can(),
providers.CanUseSSHFP: providers.Can(),
providers.CanUseSRV: providers.Can(),
providers.CanUseSSHFP: providers.Can(),
providers.CanUseTLSA: providers.Can(),
providers.DocCreateDomains: providers.Cannot("Requires domain registered through Web UI"),
providers.DocDualHost: providers.Can(),
Expand Down
Loading