Skip to content

Commit 3f3044f

Browse files
committed
Handle edge node with no host switch spec
When an edge node is created from OVA or is a bare metal node, it should be imported into state before it's being configured. In this case it will not have a host switch configuration. Signed-off-by: Kobi Samoray <[email protected]>
1 parent a0354fd commit 3f3044f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nsxt/resource_nsxt_edge_transport_node.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -1222,9 +1222,11 @@ func resourceNsxtEdgeTransportNodeRead(d *schema.ResourceData, m interface{}) er
12221222
setMPTagsInSchema(d, obj.Tags)
12231223
d.Set("failure_domain", obj.FailureDomainId)
12241224

1225-
err = setHostSwitchSpecInSchema(d, obj.HostSwitchSpec, nodeTypeEdge)
1226-
if err != nil {
1227-
return handleReadError(d, "TransportNode", id, err)
1225+
if obj.HostSwitchSpec != nil {
1226+
err = setHostSwitchSpecInSchema(d, obj.HostSwitchSpec, nodeTypeEdge)
1227+
if err != nil {
1228+
return handleReadError(d, "TransportNode", id, err)
1229+
}
12281230
}
12291231

12301232
converter := bindings.NewTypeConverter()

0 commit comments

Comments
 (0)