vatesfr / terraform-provider-xenorchestra

Xen Orchestra provider for Terraform
MIT License
150 stars 33 forks source link

Data sources should error when no results are found #140

Closed ddelnano closed 3 years ago

ddelnano commented 3 years ago

While currently debugging an issue with using the xenorchestra_vdi data source, I realized that when results are not found the error is silently ignored. This causes an issue when the dependent terraform code tries to read the data source's attribute values like so.


Error: "cdrom.0.id": required field is not set

  on devbox.tf line 14, in resource "xenorchestra_vm" "devbox":
  14: resource "xenorchestra_vm" "devbox" {

For resources this behavior is correct because it will need to be created if it doesn't exist, however, since data sources are supposed to identify infrastructure that already exists this is a bug.

ddelnano commented 3 years ago

This fix will be released in v0.19.0 of the provider.