-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
otk: error when a
otk.include
inside a dict override the dict
We allow the following: ```yaml otk.target.osbuild: sub: c: d otk.include: "foo.yaml" ``` The current semantic is that if the resolved value of `foo.yaml` is in itself a dict the two are merged and if it's a non-dict value the `sub` tree is replaced with the scalar value from `foo.yaml`. However in the above example this can lead to unexpected results, i.e. depending on how `foo.yaml` resolves `c: d` is removed or kept. This commit make it an error if an `otk.include` inside a non empty dict returns a scalar. We *could* consider also making it a warning but I fail to see a use-case right now (that is not contrived) where this would not be unexpected/unwanted behavior.
- Loading branch information
Showing
4 changed files
with
10 additions
and
0 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
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 @@ | ||
otk.include '08-include-scalar-siblings/foo.yaml' overrides non-empty dict {'c': 'd'} with 'foo' |
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,6 @@ | ||
otk.version: 1 | ||
|
||
otk.target.osbuild: | ||
sub: | ||
c: d | ||
otk.include: "08-include-scalar-siblings/foo.yaml" |
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 @@ | ||
foo |