fix(auto): keep first matching zone file for duplicate origins (#8216)

Signed-off-by: immanuwell <pchpr.00@list.ru>
This commit is contained in:
Immanuel Tikhonov
2026-07-10 04:43:07 +04:00
committed by GitHub
parent 1e01c0ad7c
commit 5cab9853cd
2 changed files with 34 additions and 1 deletions

View File

@@ -44,12 +44,14 @@ func (a Auto) Walk() error {
cleanPath := filepath.Clean(path)
if previous, ok := seen[origin]; ok && previous != cleanPath {
log.Warningf("Multiple zone files match origin %q: using %q instead of %q", origin, path, previous)
toDelete[origin] = false
return nil
}
seen[origin] = cleanPath
if z, ok := a.Z[origin]; ok {
toDelete[origin] = false
z.SetFile(path)
z.SetFile(cleanPath)
return nil
}