Enhancements to the deployment merge function #248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to fix the below described problems, while also providing additional unit test.
Problem:
elmenetal3 customize --install-description) defines a partition slice that is smaller than the partition slice of the dest deployment (e.g. aninstall.yamlfile from an ISO installer media) the dest deployment partition slice is disregarded and only the src partition slice is present.Example for problem (1):
install.yamlfile in an ISO installer before customization:Source deployment that is passed to the installer media using
elemental3 customize --install-description deployment.yaml ..:After booting the customized installer media, the merged
install.yamldeployment file looks like this:Which in turn produces the following error in the
elemental-autoinstall.service:Example for problem (2):
install.yamlfile in an ISO installer before customization is the same as in problem (1) (Note that theRECOVERYpartition is defined).elemental3 customize --install-description deployment.yaml ..:install.yamldeployment file looks like this:RECOVERYpartition that was present in the destination deployment is now missing - This happens because theignitionpartition essentially overrides theRECOVERYpartition, as partitions with index 1 are merged.ELEMENTAL-PREPAREpartition from the source was merged with theSYSTEMpartition from dest deployment - This happens due to the merge of partitions with index 2 from both the src (ELEMNTAL-PREPARE) and dest (SYSTEM) deployments.elemental-autoinstall.service:Proposed Solution:
Example with proposed solution:
install.yamlfile in an ISO installer before customization is the same as in problem (1)deployment.yamlsource file is the same as in problem (2)install.yamlfile looks like this:This essentially ensures that all partitions are merged accordingly to their counterparts, or just appended if said counterparts do not exit.