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.
- users are made aware of this behaviour and have to use different filenames
- the target needs to be duplicated an is allowed to appear multiple times in the same file with different labels
- 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) |
|
} |
|
} |
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.
certspotter-sd/internal/discovery/discovery.go
Lines 123 to 131 in 2bc7e23