Skip to content

Commit

Permalink
add cluster_reference check before set avoid in case of overlay subnets
Browse files Browse the repository at this point in the history
  • Loading branch information
bhati-pradeep authored and siddharth-nutanix committed Feb 9, 2022
1 parent ae57810 commit d2f50d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nutanix/data_source_nutanix_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,11 @@ func dataSourceNutanixSubnetRead(d *schema.ResourceData, meta interface{}) error
return err
}

d.Set("cluster_reference_name", utils.StringValue(resp.Status.ClusterReference.Name))
//cluster reference is not there for overlay subnet
if resp.Status.ClusterReference != nil {
d.Set("cluster_reference_name", utils.StringValue(resp.Status.ClusterReference.Name))
}

d.Set("api_version", utils.StringValue(resp.APIVersion))
d.Set("name", utils.StringValue(resp.Status.Name))
d.Set("description", utils.StringValue(resp.Status.Description))
Expand Down

0 comments on commit d2f50d8

Please sign in to comment.