Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: nest datapath in parents to prevent collision in nested import.git #6878

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading