This repository has been archived by the owner on Dec 5, 2020. It is now read-only.
Added nil check for empty lists in Ignition Config builders #7
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.
Added unit test for Ignition Config testing builders
If we pass an empty list down into any of the Ignition Config units
(disk, raid, filesystem, file, systemd unit, networkd unit, user,
group), the build function for the unit will panic as list will contain
nill interfaces (for each empty list passed in).
I ran into this issue when I was creating modules to EC2 instances. I want the ability to pass down different ignition units so I can customize the instance when calling the module. To allow this I define variables as empty lists, so you are not required to pass a list down. However the config builder would panic as the empty lists were turned into
nil []interface
s. Adding a nil check took care of it.Signed-off-by: Ken Herner ken@astronomer.io