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 []interfaces. Adding a nil check took care of it.
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