【发布时间】:2022-06-30 00:07:22
【问题描述】:
我有关注master.yaml 文件
root:
- name: First
some_value: One
- name: Second
some_value: Two
和update.yaml 文件
defaults:
other_value: true
one_more: Three
预期结果是:
root:
- name: First
some_value: One
other_value: true
one_more: Three
- name: Second
some_value: Two
other_value: true
one_more: Three
我尝试了以下命令:
yq eval-all '(select(fileIndex == 0).root.[] *+ select(fileIndex == 1).defaults)' './master.yaml' './update.yaml'
但结果是:
name: First
some_value: One
other_value: true
one_more: Three
name: Second
some_value: Two
other_value: true
one_more: Three
【问题讨论】: