vatesfr / terraform-provider-xenorchestra

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

extending storage repository data source attributes #159

Closed gohumble closed 3 years ago

gohumble commented 3 years ago

Hi @ddelnano,

this PR should extend the storage repository data source attributes to have more information.

Added following attributes:

Only did some manual testing.

I was not able to run the acceptance tests for my current development environment. Hope you can run the tests in your env to check if something else is effected by this PR.

ddelnano commented 3 years ago

This lgtm, but I think we should add test coverage for these new attributes. The following git diff should do the trick (copy to a file and git apply it)

diff --git a/xoa/data_source_xenorchestra_sr_test.go b/xoa/data_source_xenorchestra_sr_test.go
index a63af9f..a2679c7 100644
--- a/xoa/data_source_xenorchestra_sr_test.go
+++ b/xoa/data_source_xenorchestra_sr_test.go
@@ -25,6 +25,10 @@ func TestAccXenorchestraDataSource_storageRepository(t *testing.T) {
                                        resource.TestCheckResourceAttrSet(resourceName, "sr_type"),
                                        resource.TestCheckResourceAttrSet(resourceName, "pool_id"),
                                        resource.TestCheckResourceAttrSet(resourceName, "uuid"),
+                                       resource.TestCheckResourceAttrSet(resourceName, "container"),
+                                       resource.TestCheckResourceAttrSet(resourceName, "size"),
+                                       resource.TestCheckResourceAttrSet(resourceName, "physical_usage"),
+                                       resource.TestCheckResourceAttrSet(resourceName, "usage"),
                                        resource.TestCheckResourceAttr(resourceName, "name_label", accDefaultSr.NameLabel)),
                        },
                },

Once that is added it will be ready to merge.

gohumble commented 3 years ago

Thanks. I've added the new attributes to the storage repository test.

ddelnano commented 3 years ago

This will be released later today in v0.20.1.