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

Commit d188d56

Browse files
authored
Merge pull request #70 from njhale/fix/local-gc
Elide "local" records from purge set
2 parents 17a4686 + 0b97ed3 commit d188d56

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/backend/purger.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ func (b *backend) purge() {
7171
return
7272
}
7373

74+
// Elide records for "local" FQDNs, these won't exist in the database but shouldn't be deleted.
75+
localSuffix := ".local." + b.baseDomain
76+
for pair := range recordsToDelete {
77+
if strings.HasSuffix(pair.FQDN, localSuffix) {
78+
delete(recordsToDelete, pair)
79+
}
80+
}
81+
7482
if len(recordsToDelete) == 0 {
7583
logrus.Infof("Records purged from Route53: 0")
7684
return

0 commit comments

Comments
 (0)