> Rather than this just being a string we could use [dataSourceXoaHost](https://github.com/terra-farm/terraform-provider-xenorchestra/blob/6d0b85c152094efd9ee16ad0c8b6a080b701c305/xoa/data_source_host.go#L10) which would give us access to all the attributes that the individual host data source supports. Right now that is just `name_label` and `id` but that could include CPUs, hostnames, memory, XCP version, etc in the future #131
Rather than this just being a string we could use dataSourceXoaHost which would give us access to all the attributes that the individual host data source supports. Right now that is just name_label and id but that could include CPUs, hostnames, memory, XCP version, etc in the future
I tried really hard to return a slice of hoststructs from GetHostsByPoolName() and reuse the dataSourceXoaHost to set the hosts based on the hostschema. Terraform won't transform the results as needed. This always results in an error telling me :
Invalid address to set: []string{"hosts", "0", "Id"}
I am a little stuck here. Need to do a little more research and debugging. Maybe you have a quick solution for this error?
I wasn't able to reproduce the Invalid address to set: []string{"hosts", "0", "Id"} issue you mentioned above. However, I was able to get the tests passing and ensure that the hosts attribute was properly set. You can see the changes I made on pr-review-add-hosts-data-source
I tried really hard to return a slice of
host
structs from GetHostsByPoolName() and reuse the dataSourceXoaHost to set thehosts
based on thehost
schema. Terraform won't transform the results as needed. This always results in an error telling me :Invalid address to set: []string{"hosts", "0", "Id"}
I am a little stuck here. Need to do a little more research and debugging. Maybe you have a quick solution for this error?
_Originally posted by @gohumble in https://github.com/terra-farm/terraform-provider-xenorchestra/pull/126#discussion_r584566606_
I wasn't able to reproduce the
Invalid address to set: []string{"hosts", "0", "Id"}
issue you mentioned above. However, I was able to get the tests passing and ensure that thehosts
attribute was properly set. You can see the changes I made on pr-review-add-hosts-data-source