Skip to content

Commit

Permalink
Merge pull request #1107 from ksamoray/edge_node_import
Browse files Browse the repository at this point in the history
Handle edge_node import failures
  • Loading branch information
ksamoray authored Feb 13, 2024
2 parents cef6ce5 + efccd32 commit 3127f28
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions nsxt/resource_nsxt_edge_transport_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1232,14 +1232,18 @@ func resourceNsxtEdgeTransportNodeRead(d *schema.ResourceData, m interface{}) er
}
node := base.(model.EdgeNode)

err = setEdgeDeploymentConfigInSchema(d, node.DeploymentConfig)
if err != nil {
return handleReadError(d, "TransportNode", id, err)
if node.DeploymentConfig != nil {
err = setEdgeDeploymentConfigInSchema(d, node.DeploymentConfig)
if err != nil {
return handleReadError(d, "TransportNode", id, err)
}
}

err = setEdgeNodeSettingsInSchema(d, node.NodeSettings)
if err != nil {
return handleReadError(d, "TransportNode", id, err)
if node.NodeSettings != nil {
err = setEdgeNodeSettingsInSchema(d, node.NodeSettings)
if err != nil {
return handleReadError(d, "TransportNode", id, err)
}
}

// Set base object attributes
Expand Down

0 comments on commit 3127f28

Please sign in to comment.