plugin/auto: fix inverted arguments in duplicate-origin warning (#8317)

The warning added in #8216 passed the skipped file where the kept file
belongs and vice versa, so it logged "using <skipped> instead of <kept>"
— the reverse of what Walk actually does. Swap the arguments (and use
cleanPath for both) so the message names the file that is being used.
Strengthen TestWalkWarnsForDuplicateOrigin to assert the direction; it
only checked that both names appeared, so the inversion passed before.

Signed-off-by: maximilize <3752128+maximilize@users.noreply.github.com>
This commit is contained in:
maximilize
2026-07-21 11:55:47 +02:00
committed by GitHub
parent 0410236577
commit d1a6ab0eb9
2 changed files with 10 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ 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)
log.Warningf("Multiple zone files match origin %q: using %q instead of %q", origin, previous, cleanPath)
toDelete[origin] = false
return nil
}