Skip to content

Commit d05ff52

Browse files
authored
Merge branch 'main' into issue_701
2 parents 7f442e8 + e0a4fa7 commit d05ff52

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/ibmvpc/parser.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ func (tgw *TransitGateway) addVPC(vpc *VPC, tgwConn *datamodel.TransitConnection
940940
}
941941
}
942942

943+
//nolint:gocyclo // keep this function without splits
943944
func getTgwObjects(c *datamodel.ResourcesContainerModel,
944945
res *vpcmodel.MultipleVPCConfigs,
945946
resourceGroup string,
@@ -951,6 +952,15 @@ func getTgwObjects(c *datamodel.ResourcesContainerModel,
951952

952953
tgwConnList := slices.Clone(c.TransitConnectionList)
953954
for i, tgwConn := range c.TransitConnectionList {
955+
if tgwConn.TransitGateway.Crn == nil || tgwConn.TransitGateway.Name == nil || tgwConn.NetworkID == nil {
956+
var tgConnName string
957+
if tgwConn.Name != nil {
958+
tgConnName = *tgwConn.Name
959+
}
960+
logging.Warnf("skipping TransitConnection (%s), missing TransitGateway crn/name/networkID", tgConnName)
961+
continue
962+
}
963+
954964
tgwUID := *tgwConn.TransitGateway.Crn
955965
tgwName := *tgwConn.TransitGateway.Name
956966
vpcUID := *tgwConn.NetworkID

0 commit comments

Comments
 (0)