Skip to content

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

@xinau

Description

@xinau

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)
}
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions