Skip to content

Commit

Permalink
Merge pull request #183 from yannickstruyf3/bugfix/projects-optional-…
Browse files Browse the repository at this point in the history
…resource-domain

made resource_domain optional -> quotas are also optional in projects
  • Loading branch information
marinsalinas authored Nov 17, 2020
2 parents 904ad6c + 2f3ea52 commit a93c052
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nutanix/resource_nutanix_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func resourceNutanixProject() *schema.Resource {
},
"resource_domain": {
Type: schema.TypeList,
Required: true,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"resources": {
Expand Down Expand Up @@ -505,7 +506,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{})

Expand Down

0 comments on commit a93c052

Please sign in to comment.