-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[config] stop merging arrays from multiple configs (#161884)
## Summary Fix an unwanted behavior of the config merging logic, that was merging arrays the same way objects are merged. E.g the output of `getConfigFromFiles(file1, file2)` with ```yaml ### file 1 array: [1, 2, 3] obj_array: - id: 1 - id: 2 ### file 2 array: [4] obj_array: - id: 3 ``` was ```yaml array: [4, 2, 3] obj_array: - id: 3 - id: 2 ``` instead of ```yaml array: [4] obj_array: - id: 3 ``` Which is causing problems when merging the default, serverless, serverless project and dev file in some scenarios.
- Loading branch information
1 parent
37b48d3
commit a9f6e03
Showing
5 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
foo: 1 | ||
bar: 3 | ||
arr1: [1, 2, 3] | ||
arr2: [42, 90] | ||
nested: | ||
str1: "foo" | ||
str2: "hello" | ||
obj_array: | ||
- id: 1 | ||
- id: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
foo: 2 | ||
arr1: [4, 5] | ||
arr2: [] | ||
nested: | ||
str1: "bar" | ||
str3: "dolly" | ||
obj_array: | ||
- id: 3 |
22 changes: 22 additions & 0 deletions
22
packages/kbn-config/src/raw/__snapshots__/read_config.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters