Open mackaybe opened 3 weeks ago
Describe the bug Encoding to yaml only encodes the first document to a string
Note that any how to questions should be posted in the discussion board and not raised as an issue.
Version of yq: 4.42.1 Operating system: osx or linux Installed via: homebrew and manual build
Input Yaml
foo.yml:
build: no data: test.yaml: | a: b type: plain --- c: d type: juicy --- e: f type: greenish
Command The command you ran:
yq '.data."test.yaml" = (.data."test.yaml" | from_yaml | select(.type == "juicy").c = "DD" | to_yaml)' foo.yaml
Actual behavior
build: no data: test.yaml: | a: b type: plain
Expected behavior
build: no data: test.yaml: | a: b type: plain --- c: DD type: juicy --- e: f type: greenish
Additional context
I get the same result for this:
export manifests=$(yq '.data."test.yaml"' foo.yaml | yq 'select(.type == "juicy").c = "DD"') yq '.data."test.yaml" = env(manifests)' foo.yaml
this works as expected
yq '.data."test.yaml"' foo.yaml | yq 'select(.type == "juicy").c = "DD" | to_yaml'
4.44.1 has same issue on osx
Verified - needs fix
Describe the bug Encoding to yaml only encodes the first document to a string
Note that any how to questions should be posted in the discussion board and not raised as an issue.
Version of yq: 4.42.1 Operating system: osx or linux Installed via: homebrew and manual build
Input Yaml
foo.yml:
Command The command you ran:
Actual behavior
Expected behavior
Additional context
I get the same result for this:
this works as expected