Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/discovery: multiple matching file configs override target labels #1

Open
xinau opened this issue Dec 1, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xinau
Copy link
Contributor

xinau commented Dec 1, 2020

when a target matches multiple file configurations with the same filename the labels can are overriden by the last matching file config.
I'm currently unsure what the correct approach to solving this issue is.

  1. users are made aware of this behaviour and have to use different filenames
  2. the target needs to be duplicated an is allowed to appear multiple times in the same file with different labels
  3. the target is filtered out by the first matching file config and other configurations with the same filename are skipped

for _, tg := range tgs {
for _, cfg := range cfgs {
if !tg.Matches(cfg.MatchRE) {
continue
}
tg.AddLabels(cfg.Labels)
files[cfg.File] = append(files[cfg.File], tg)
}
}

@xinau xinau added the bug Something isn't working label Dec 1, 2020
@xinau xinau self-assigned this Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant