Skip to content
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

Drop support for metadata records #403

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
802 changes: 409 additions & 393 deletions README.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions charts/external-dns-management/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ spec:
{{- if .Values.configuration.compoundLockStatusCheckPeriod }}
- --compound.lock-status-check-period={{ .Values.configuration.compoundLockStatusCheckPeriod }}
{{- end }}
{{- if .Values.configuration.compoundMaxMetadataRecordDeletionsPerReconciliation }}
- --compound.max-metadata-record-deletions-per-reconciliation={{ .Values.configuration.compoundMaxMetadataRecordDeletionsPerReconciliation }}
{{- end }}
{{- if .Values.configuration.compoundNetlifyDnsAdvancedBatchSize }}
- --compound.netlify-dns.advanced.batch-size={{ .Values.configuration.compoundNetlifyDnsAdvancedBatchSize }}
{{- end }}
Expand Down Expand Up @@ -420,9 +423,6 @@ spec:
{{- if .Values.configuration.compoundSetup }}
- --compound.setup={{ .Values.configuration.compoundSetup }}
{{- end }}
{{- if .Values.configuration.compoundStatisticPoolSize }}
- --compound.statistic.pool.size={{ .Values.configuration.compoundStatisticPoolSize }}
{{- end }}
{{- if .Values.configuration.compoundTtl }}
- --compound.ttl={{ .Values.configuration.compoundTtl }}
{{- end }}
Expand Down Expand Up @@ -801,6 +801,9 @@ spec:
{{- if .Values.configuration.maintainer }}
- --maintainer={{ .Values.configuration.maintainer }}
{{- end }}
{{- if .Values.configuration.maxMetadataRecordDeletionsPerReconciliation }}
- --max-metadata-record-deletions-per-reconciliation={{ .Values.configuration.maxMetadataRecordDeletionsPerReconciliation }}
{{- end }}
{{- if .Values.configuration.namespace }}
- --namespace={{ .Values.configuration.namespace }}
{{- end }}
Expand Down Expand Up @@ -975,9 +978,6 @@ spec:
{{- if .Values.configuration.setup }}
- --setup={{ .Values.configuration.setup }}
{{- end }}
{{- if .Values.configuration.statisticPoolSize }}
- --statistic.pool.size={{ .Values.configuration.statisticPoolSize }}
{{- end }}
{{- if .Values.configuration.target }}
- --target={{ .Values.configuration.target }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/external-dns-management/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ configuration:
# compoundInfobloxDnsRatelimiterEnabled:
# compoundInfobloxDnsRatelimiterQps:
# compoundLockStatusCheckPeriod:
# compoundMaxMetadataRecordDeletionsPerReconciliation:
# compoundNetlifyDnsAdvancedBatchSize:
# compoundNetlifyDnsAdvancedMaxRetries:
# compoundNetlifyDnsRatelimiterBurst:
Expand Down Expand Up @@ -164,7 +165,6 @@ configuration:
# compoundRfc2136RatelimiterQps:
# compoundSecretsPoolSize: 2
# compoundSetup: 10
# compoundStatisticPoolSize:
# compoundTtl: 120
# compoundZonepoliciesPoolSize:
# config:
Expand Down Expand Up @@ -291,6 +291,7 @@ configuration:
# lockStatusCheckPeriod:
# logLevel: info
# maintainer:
# maxMetadataRecordDeletionsPerReconciliation:
# namespace: default
# namespaceLocalAccessOnly: false
# netlifyDnsAdvancedBatchSize:
Expand Down Expand Up @@ -350,7 +351,6 @@ configuration:
# serviceDNSTargetsPoolSize: 2
# servicesPoolSize:
# setup: 10
# statisticPoolSize:
# target: ""
# targetCreatorLabelName: ""
# targetCreatorLabelValue: ""
Expand Down
2 changes: 2 additions & 0 deletions examples/60-owner.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Please note that starting with release `v0.23` DNSOwner resources are only used to clean up metadata DNS records.
# The owner identifiers are not used for any other purpose anymore.
apiVersion: dns.gardener.cloud/v1alpha1
kind: DNSOwner
metadata:
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/alicloud/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return state, nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := raw.ExecuteRequests(logger, &h.config, h.access, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/provider/aws/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ func buildResourceRecordSet(ctx context.Context, name dns.DNSSetName, policy *dn
}

func (this *Execution) addChange(ctx context.Context, action route53types.ChangeAction, req *provider.ChangeRequest, dnsset *dns.DNSSet) error {
name, rset := dns.MapToProvider(req.Type, dnsset, this.zone.Domain())
name = name.Align()
name := dnsset.Name.Align()
rset := dnsset.Sets[req.Type]
if len(rset.Records) == 0 {
return nil
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/aws/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
ctx := context.Background()
err := h.executeRequests(ctx, logger, zone, state, reqs)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/provider/azure-private/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ func (exec *Execution) buildRecordSet(req *provider.ChangeRequest) (buildStatus,
return bs_invalidRoutingPolicy, "", nil
}

setName, rset := dns.MapToProvider(req.Type, dnsset, exec.zoneName)
name, ok := utils.DropZoneName(setName.DNSName, exec.zoneName)
name, ok := utils.DropZoneName(dnsset.Name.DNSName, exec.zoneName)
if !ok {
return bs_invalidName, "", &armprivatedns.RecordSet{Name: &name}
}

rset := dnsset.Sets[req.Type]
if len(rset.Records) == 0 {
return bs_empty, "", nil
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/azure-private/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := h.executeRequests(logger, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/provider/azure/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ func (exec *Execution) buildRecordSet(req *provider.ChangeRequest) (buildStatus,
return bs_invalidRoutingPolicy, "", nil
}

setName, rset := dns.MapToProvider(req.Type, dnsset, exec.zoneName)
name, ok := utils.DropZoneName(setName.DNSName, exec.zoneName)
name, ok := utils.DropZoneName(dnsset.Name.DNSName, exec.zoneName)
if !ok {
return bs_invalidName, "", &armdns.RecordSet{Name: &name}
}

rset := dnsset.Sets[req.Type]
if len(rset.Records) == 0 {
return bs_empty, "", nil
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/azure/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := h.executeRequests(logger, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/cloudflare/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return state, nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := raw.ExecuteRequests(logger, &h.config, h.access, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/provider/google/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ func (this *Execution) addChange(req *provider.ChangeRequest) {
var err error

if req.Addition != nil {
setName, newset = dns.MapToProvider(req.Type, req.Addition, this.zone.Domain())
setName = req.Addition.Name
newset = req.Addition.Sets[req.Type]
policy, err = extractRoutingPolicy(req.Addition)
}
if req.Deletion != nil {
setName, oldset = dns.MapToProvider(req.Type, req.Deletion, this.zone.Domain())
setName = req.Deletion.Name
oldset = req.Deletion.Sets[req.Type]
if req.Addition == nil {
policy, err = extractRoutingPolicy(req.Deletion)
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/google/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := h.executeRequests(logger, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/mock/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return h.mock.CloneZoneState(zone)
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := h.executeRequests(logger, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/netlify/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return state, nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := raw.ExecuteRequests(logger, &h.config, h.access, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/provider/openstack/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func (exec *Execution) buildRecordSet(req *provider.ChangeRequest) (buildStatus,
return bsInvalidRoutingPolicy, nil
}

name, rset := dns.MapToProvider(req.Type, dnsset, exec.zone.Domain())

name := dnsset.Name
rset := dnsset.Sets[req.Type]
if len(rset.Records) == 0 {
return bsEmpty, nil
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/openstack/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

// ExecuteRequests applies a given change request to a given hosted zone.
func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := h.executeRequests(logger, zone, state, reqs)
Expand Down
38 changes: 3 additions & 35 deletions pkg/controller/provider/openstack/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,24 +268,12 @@ func TestGetZoneStateAndExecuteRequests(t *testing.T) {
Type: "A",
Records: []string{"1.2.3.4", "5.6.7.8"},
},
{
Name: "comment-sub1.z1.test.",
TTL: 600,
Type: "TXT",
Records: []string{"\"owner=test\"", "\"prefix=comment-\""},
},
{
Name: "sub2.z1.test.",
TTL: 302,
Type: "CNAME",
Records: []string{"cname.target.test."},
},
{
Name: "comment-sub2.z1.test.",
TTL: 600,
Type: "TXT",
Records: []string{"\"owner=test\"", "\"prefix=comment-\""},
},
{
Name: "sub3.z1.test.",
TTL: 303,
Expand All @@ -298,23 +286,20 @@ func TestGetZoneStateAndExecuteRequests(t *testing.T) {
Ω(err).ShouldNot(HaveOccurred(), fmt.Sprintf("CreateRecordSet failed for %s %s", opts.Name, opts.Type))
}

stdMeta := buildRecordSet("META", 600, "\"owner=test\"", "\"prefix=comment-\"")
sub1 := dns.DNSSetName{DNSName: "sub1.z1.test"}
sub2 := dns.DNSSetName{DNSName: "sub2.z1.test"}
sub3 := dns.DNSSetName{DNSName: "sub3.z1.test"}
expectedDnssets := dns.DNSSets{
sub1: &dns.DNSSet{
Name: sub1,
Sets: dns.RecordSets{
"A": buildRecordSet("A", 301, "1.2.3.4", "5.6.7.8"),
"META": stdMeta,
"A": buildRecordSet("A", 301, "1.2.3.4", "5.6.7.8"),
},
},
sub2: &dns.DNSSet{
Name: sub2,
Sets: dns.RecordSets{
"CNAME": buildRecordSet("CNAME", 302, "cname.target.test"),
"META": stdMeta,
},
},
dns.DNSSetName{DNSName: "sub3.z1.test"}: &dns.DNSSet{
Expand Down Expand Up @@ -343,16 +328,6 @@ func TestGetZoneStateAndExecuteRequests(t *testing.T) {
},
},
},
{
Action: provider.R_CREATE,
Type: "META",
Addition: &dns.DNSSet{
Name: sub4,
Sets: dns.RecordSets{
"META": stdMeta,
},
},
},
{
Action: provider.R_UPDATE,
Type: "A",
Expand All @@ -368,11 +343,6 @@ func TestGetZoneStateAndExecuteRequests(t *testing.T) {
Type: "CNAME",
Deletion: expectedDnssets[sub2],
},
{
Action: provider.R_DELETE,
Type: "META",
Deletion: expectedDnssets[sub2],
},
{
Action: provider.R_DELETE,
Type: "TXT",
Expand All @@ -386,15 +356,13 @@ func TestGetZoneStateAndExecuteRequests(t *testing.T) {
sub1: &dns.DNSSet{
Name: sub1,
Sets: dns.RecordSets{
"A": buildRecordSet("A", 305, "1.2.3.55", "5.6.7.8"),
"META": stdMeta,
"A": buildRecordSet("A", 305, "1.2.3.55", "5.6.7.8"),
},
},
sub4: &dns.DNSSet{
Name: sub4,
Sets: dns.RecordSets{
"A": buildRecordSet("A", 304, "11.22.33.44"),
"META": stdMeta,
"A": buildRecordSet("A", 304, "11.22.33.44"),
},
},
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/provider/powerdns/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func (exec *Execution) buildRecordSet(req *provider.ChangeRequest) (*RecordSet,
dnsset = req.Deletion
}

name, rset := dns.MapToProvider(req.Type, dnsset, exec.zone.Domain())
name := dnsset.Name
rset := dnsset.Sets[req.Type]

if name.SetIdentifier != "" || dnsset.RoutingPolicy != nil {
return nil, fmt.Errorf("routing policies not supported for " + TYPE_CODE)
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/powerdns/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := h.executeRequests(logger, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/remote/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) MapTargets(dnsName string, targets []provider.Target) []provider.Target {
if h.isAWSRoute53(dnsName) {
return mapping.MapTargets(targets)
Expand Down
6 changes: 4 additions & 2 deletions pkg/controller/provider/rfc2136/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ func (exec *Execution) buildRecordSet(req *provider.ChangeRequest) ([]miekgdns.R

domain := dns.NormalizeHostname(exec.handler.zone)
if req.Addition != nil {
setName, addset = dns.MapToProvider(req.Type, req.Addition, domain)
setName = req.Addition.Name
addset = req.Addition.Sets[req.Type]
}
if req.Deletion != nil {
setName, delset = dns.MapToProvider(req.Type, req.Deletion, domain)
setName = req.Deletion.Name
delset = req.Deletion.Sets[req.Type]
}
if setName.DNSName == "" || (addset.Length() == 0 && delset.Length() == 0) {
return nil, nil, nil
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/provider/rfc2136/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,6 @@ func (h *Handler) getZoneState(zone provider.DNSHostedZone, _ provider.ZoneCache
return provider.NewDNSZoneState(dnssets), nil
}

func (h *Handler) ReportZoneStateConflict(zone provider.DNSHostedZone, err error) bool {
return h.cache.ReportZoneStateConflict(zone, err)
}

func (h *Handler) ExecuteRequests(logger logger.LogContext, zone provider.DNSHostedZone, state provider.DNSZoneState, reqs []*provider.ChangeRequest) error {
err := h.executeRequests(logger, zone, state, reqs)
h.cache.ApplyRequests(logger, err, zone, reqs)
Expand Down
Loading
Loading