Skip to content

Commit

Permalink
Backport: nest datapath in parents to prevent collision in nested imp…
Browse files Browse the repository at this point in the history
…ort git (#6878)
  • Loading branch information
wildum authored Sep 2, 2024
1 parent c2a37b7 commit d35ff5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Main (unreleased)
- Fix a bug where custom components would not shadow the stdlib. If you have a module whose name conflicts with an stdlib function
and if you use this exact function in your config, then you will need to rename your module. (@wildum)

- Fix an issue where nested import.git config blocks could conflict if they had the same labels. (@wildum)

### Other changes

- Change the Docker base image for Linux containers to `ubuntu:noble`. (@amontalban)
Expand Down
2 changes: 2 additions & 0 deletions internal/flow/internal/controller/node_config_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d35ff5e

Please sign in to comment.