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

[docs]: Understanding how merge rules work #5866

Open
bilby91 opened this issue Nov 12, 2024 · 0 comments
Open

[docs]: Understanding how merge rules work #5866

bilby91 opened this issue Nov 12, 2024 · 0 comments
Labels
documentation This Pull Request changes documentation new An issue that still needs triage

Comments

@bilby91
Copy link

bilby91 commented Nov 12, 2024

Documentation request

https://cloudinit.readthedocs.io/en/latest/reference/merging.html#specifying-multiple-types-and-what-this-does

Hello,

I'm trying to understand how merging rules behave, since I'm getting a different behavior than my interpretation of the documentation.

I have a simple case, where, I'm using a #cloud-config-archive with two #cloud-config parts. Let's call them CC1 (cloud-config 1) and CC2 (cloud-config 2).

#cloud-config-archive
- type: 'text/cloud-config'
  content: |
  #cloud-config
  merge_how:
  - name: list
    settings: ['append']
  - name: list
    settings: ['no_replace', 'recurse_list']
  runcmd:
  - echo "Hello, World!" > /tmp/hello.txt

- type: 'text/cloud-config'
  content: |
  #cloud-config
  runcmd:
  - echo "Hello, World! 2" > /tmp/hello2.txt

Based on the documentation, my interpretation is that, after CC1 is processed, merge_how rules will apply to CC2 gets merged into CC1. That doesn't seem to be happening. Now, if I move the merge_how rules to CC2, I get the expected behavior where runcmd has both commands.

I just want to understand if I'm misunderstanding the documentation and there might be an opportunity for improvement.

Thanks

@bilby91 bilby91 added documentation This Pull Request changes documentation new An issue that still needs triage labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This Pull Request changes documentation new An issue that still needs triage
Projects
None yet
Development

No branches or pull requests

1 participant