Merging of image yml files
This is a discussion issue to figure out how we handle multiple image yml files. As of this writing, and the recently merged #849, we have multiple rootfs image files:
- A core
rootfs.ymlwhich contains all of the common information for images - A patch file per unique build, e.g. Xen or KVM or RPi
Actually, each is a .yml.in which then is merged and patched, but getting past .in files is a separate discussion.
The problem with using patch files in this use case is that they are brittle. They have very specific lines that you add/remove/change. This works well for source code, where lines have little inherent structure. yml (and json) are by definition structured and easy to patch. There even are RFC standards for json patch and json merge patch.
The kubernetes version of strategic merge patch is even easier, but depends on some annotations.
A JSON Patch to replace rootfs-acrn.yml.in would look something like: