remove default value from disk scsi #690
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.
Signed-off-by: Ricardo Mateus rmateus@suse.com
Linux distribution: Leap 15.1
Terraform version: Terraform v0.12.13
Provider and libvirt versions:
Provider version distributed for sumaform, but I also tested building from head (commit:
db13b678ab16fe9dca024c3daea6e56fb4cc4ae2
)Terraform return an
Error: Provider produced inconsistent final plan
error when we have an extra disk on sumaform, using the dynamic disk block.Full error:
With some research, we found out that this is a problem in terraform itself. Terraform doesn't deal well with dynamic block generation when using some functions to manipulate the array of elements(like split or concat). In hashicorp/terraform#21157 the slice function is corrected, but they are probably missing the fix to the concat function.
If we remove the default value for disk scsi, the disk block don't have any value know before apply, and in this way terraform is able to handle the plan inconsistency, since all values will be known after apply.
Remove this default values doesn't look to impact in the provider execution, since after apply the value will be false also.
Reproduce
Clone this branch: https://github.com/uyuni-project/sumaform/tree/libvirt_concat_error
Run terraform apply again and the error disappears since both disks are created and now terraform can compute the correct values.