diff --git a/CHANGELOG.md b/CHANGELOG.md index d3021ebe446b..88fd42d9e7e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ Main (unreleased) - Fix an issue where JSON string array elements were not parsed correctly in `loki.source.cloudflare`. (@thampiotr) +- Fix an issue where nested import.git config blocks could conflict if they had the same labels. (@wildum) - Fix SSRF vulnerability in `faro.receiver` by disabling source map download. (@hainenber) diff --git a/internal/flow/internal/controller/node_config_import.go b/internal/flow/internal/controller/node_config_import.go index e87a1223cc5b..35f7dd409533 100644 --- a/internal/flow/internal/controller/node_config_import.go +++ b/internal/flow/internal/controller/node_config_import.go @@ -286,6 +286,8 @@ func (cn *ImportConfigNode) processImportBlock(stmt *ast.BlockStmt, fullName str childGlobals := cn.globals // Children have a special OnBlockNodeUpdate function which notifies the parent when its content changes. childGlobals.OnBlockNodeUpdate = cn.onChildrenContentUpdate + // Children data paths are nested inside their parents to avoid collisions. + childGlobals.DataPath = filepath.Join(childGlobals.DataPath, cn.globalID) cn.importConfigNodesChildren[stmt.Label] = NewImportConfigNode(stmt, childGlobals, sourceType) return nil }