mirror of
https://github.com/coredns/coredns.git
synced 2026-07-13 11:10:10 -04:00
fix(auto): keep first matching zone file for duplicate origins (#8216)
Signed-off-by: immanuwell <pchpr.00@list.ru>
This commit is contained in:
committed by
GitHub
parent
1e01c0ad7c
commit
5cab9853cd
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user