mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-11-04 12:41:00 +01:00
Fix TXT record planning.
This commit is contained in:
parent
522107696d
commit
d934f693ff
19
plan/plan.go
19
plan/plan.go
@ -131,10 +131,10 @@ func (t planTable) getDeletes() (deleteList []*endpoint.Endpoint) {
|
|||||||
func (p *Plan) Calculate() *Plan {
|
func (p *Plan) Calculate() *Plan {
|
||||||
t := newPlanTable()
|
t := newPlanTable()
|
||||||
|
|
||||||
for _, current := range p.Current {
|
for _, current := range filterRecordsForPlan(p.Current) {
|
||||||
t.addCurrent(current)
|
t.addCurrent(current)
|
||||||
}
|
}
|
||||||
for _, desired := range p.Desired {
|
for _, desired := range filterRecordsForPlan(p.Desired) {
|
||||||
t.addCandidate(desired)
|
t.addCandidate(desired)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,3 +175,18 @@ func shouldUpdateTTL(desired, current *endpoint.Endpoint) bool {
|
|||||||
}
|
}
|
||||||
return desired.RecordTTL != current.RecordTTL
|
return desired.RecordTTL != current.RecordTTL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func filterRecordsForPlan(records []*endpoint.Endpoint) []*endpoint.Endpoint {
|
||||||
|
filtered := []*endpoint.Endpoint{}
|
||||||
|
|
||||||
|
for _, record := range records {
|
||||||
|
switch record.RecordType {
|
||||||
|
case endpoint.RecordTypeA, endpoint.RecordTypeCNAME:
|
||||||
|
filtered = append(filtered, record)
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return filtered
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user