Skip to content

Commit

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

made resource_domain optional -> quotas are also optional in projects
  • Loading branch information
marinsalinas authored Nov 17, 2020
2 parents 6a9bdd2 + 1764bde commit b5aacec
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 b5aacec

Please sign in to comment.