Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Elide "local" records from purge set #70

Merged
merged 1 commit into from
May 24, 2023
Merged
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
8 changes: 8 additions & 0 deletions pkg/backend/purger.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ func (b *backend) purge() {
return
}

// Elide records for "local" FQDNs, these won't exist in the database but shouldn't be deleted.
localSuffix := ".local." + b.baseDomain
for pair := range recordsToDelete {
if strings.HasSuffix(pair.FQDN, localSuffix) {
delete(recordsToDelete, pair)
}
}

if len(recordsToDelete) == 0 {
logrus.Infof("Records purged from Route53: 0")
return
Expand Down