Validate configuration source keys and overrides

This commit is contained in:
2026-08-13 00:15:26 +00:00
parent 5139c1a586
commit 26a681e0b1
7 changed files with 173 additions and 17 deletions

View File

@@ -72,9 +72,12 @@ func traverseReportModules(cfg *Config, opts reportModuleTraversalOptions) (map[
if _, err := reportRegistry.Lookup(reportID); err != nil {
return nil, fmt.Errorf("reports.%s: %w", key, err)
}
if !reportCfg.deterministicModulesSet {
if !reportCfg.deterministicModulesConfigured() {
continue
}
if len(reportCfg.DeterministicModules) == 0 {
return nil, fmt.Errorf("reports.%s.deterministic_modules must contain at least one entry", key)
}
items, normalized, err := moduleItemsFromConfig(moduleRegistry, key, reportCfg.DeterministicModules, opts.normalizeOptions)
if err != nil {
return nil, err
@@ -110,7 +113,7 @@ func traverseReportDistributorPathOverrides(cfg Config) (map[report.ID][]string,
if _, err := reportRegistry.Lookup(reportID); err != nil {
return nil, fmt.Errorf("reports.%s: %w", key, err)
}
if !reportCfg.Distributor.pathTemplatesSet {
if !reportCfg.Distributor.PathTemplatesSet() {
continue
}
if err := validateReportDistributorPathTemplates(key, reportID, reportCfg.Distributor.PathTemplates); err != nil {