Skip to content

Commit

Permalink
feat: virtual_machine resource - omit set ip_endpoint_list when is le…
Browse files Browse the repository at this point in the history
…aned for nic_list argument
  • Loading branch information
marinsalinas committed Mar 20, 2020
1 parent daa37e6 commit 5c946fb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nutanix/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ func flattenNicList(nics []*v3.VMNic) []map[string]interface{} {
nic["model"] = utils.StringValue(v.Model)
var ipEndpointList []map[string]interface{}
for _, v1 := range v.IPEndpointList {
ipEndpoint := make(map[string]interface{})
ipEndpoint["ip"] = utils.StringValue(v1.IP)
ipEndpoint["type"] = utils.StringValue(v1.Type)
ipEndpointList = append(ipEndpointList, ipEndpoint)
if utils.StringValue(v1.Type) != "LEARNED" {
ipEndpoint := make(map[string]interface{})
ipEndpoint["ip"] = utils.StringValue(v1.IP)
ipEndpoint["type"] = utils.StringValue(v1.Type)
ipEndpointList = append(ipEndpointList, ipEndpoint)
}
}
nic["ip_endpoint_list"] = ipEndpointList
nic["network_function_chain_reference"] = flattenReferenceValues(v.NetworkFunctionChainReference)
Expand Down

0 comments on commit 5c946fb

Please sign in to comment.