Skip to content
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

Merged
merged 1 commit into from
Aug 22, 2017

Conversation

kenXengineering
Copy link
Contributor

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.

Signed-off-by: Ken Herner ken@astronomer.io

@grubernaut grubernaut added the bug label Jul 26, 2017
@mcuadros
Copy link
Contributor

mcuadros commented Aug 4, 2017

Nice! can you rebase @chosenken ?

@mcuadros mcuadros self-requested a review August 4, 2017 10:35
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).

Signed-off-by: Ken Herner <ken@astronomer.io>
@kenXengineering
Copy link
Contributor Author

@mcuadros Just did the rebase, let me know if you need anything else, thanks!

@mcuadros mcuadros merged commit 4b473cb into hashicorp:master Aug 22, 2017
LorbusChris added a commit to LorbusChris/terraform-provider-ignition that referenced this pull request Mar 3, 2021
The `append` field is not supported in Ignition config spec v3 anymore.

Fixes  hashicorp#7
LorbusChris added a commit to LorbusChris/terraform-provider-ignition that referenced this pull request Mar 3, 2021
The `append` field is not supported in Ignition config spec v3 anymore.

Fixes  hashicorp#7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants