COMPOSER-2016: blueprint: make Convert respect nils #3612
Merged
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.
Previously, nil values in the conversion source were in some cases converted to empty arrays or empty objects. This is undesirable, because it can be in certain cases changing the semantics of the blueprint. See e.g. https://github.com/osbuild/images/blob/f317064da574a8475d438972e9c54bc67ffa1dfb/pkg/distro/rhel7/imagetype.go#L239C7-L239C7
This commit modifies the conversion process so nil values are converted without any changes. Also, the
Convert
function was covered with a unit test.This pull request includes: