Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initrd-setup-root: Add selective OS reset handling
A reconfiguration of a system will lead to config drift is the local state isn't discarded. However, while this is possible with Ignition reformatting the rootfs, this big hammer is too disruptive. Introduce a way to perform a selective OS reset where a special file contains a regex for paths to preserve. This regex should be prepared by a helper tool like flatcar-reset --keep-paths "/etc/ssh/" "/var/docker.*" that would assemble the regex to be (/etc/ssh|/etc/ssh/.*|/var/docker.*) where the omitted slash at the end of the /etc/ssh/ is needed due to how "find" prints the paths, and the additional entry ssh/.* for the contents of /etc/ssh/ which would otherwise be deleted - but we should allow the user to use a final slash anyway instead of forcing the user to add /.* everywhere, thus the helper tool should take care of it. If the user wants to remove all contents but keep the empty dir, ^/etc/ssh or /etc/ssh$ or (/etc/ssh) or /etc/(ssh) would work to directly specify the wanted regex without the helper tool expanding it.
- Loading branch information