From acbb25b09d40ebec10deccc268a5ed5c27f3ae6b Mon Sep 17 00:00:00 2001 From: Yannick Struyf Date: Tue, 17 Nov 2020 08:28:03 +0100 Subject: [PATCH 1/2] made resource_domain optional -> quotas are also optional in projects --- nutanix/resource_nutanix_project.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nutanix/resource_nutanix_project.go b/nutanix/resource_nutanix_project.go index 356db5d8a..f322caed8 100644 --- a/nutanix/resource_nutanix_project.go +++ b/nutanix/resource_nutanix_project.go @@ -40,7 +40,7 @@ func resourceNutanixProject() *schema.Resource { }, "resource_domain": { Type: schema.TypeList, - Required: true, + Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "resources": { @@ -505,7 +505,7 @@ func expandProjectSpec(d *schema.ResourceData) *v3.ProjectSpec { func expandResourceDomain(d *schema.ResourceData) *v3.ResourceDomain { resourceDomain, ok := d.GetOk("resource_domain") if !ok { - return &v3.ResourceDomain{} + return nil } resources := cast.ToStringMap(resourceDomain.([]interface{})[0])["resources"].([]interface{}) From 2f3ea5289626a1c21278e1f97d321a77625ebb4a Mon Sep 17 00:00:00 2001 From: Yannick Struyf Date: Tue, 17 Nov 2020 12:45:18 +0100 Subject: [PATCH 2/2] added max items to resource_domain --- nutanix/resource_nutanix_project.go | 1 + 1 file changed, 1 insertion(+) diff --git a/nutanix/resource_nutanix_project.go b/nutanix/resource_nutanix_project.go index f322caed8..50d08a9c2 100644 --- a/nutanix/resource_nutanix_project.go +++ b/nutanix/resource_nutanix_project.go @@ -41,6 +41,7 @@ func resourceNutanixProject() *schema.Resource { "resource_domain": { Type: schema.TypeList, Optional: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "resources": {