Skip to content

Commit

Permalink
Fix VPCConnectivityProfile
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Jul 29, 2024
1 parent b3e397c commit 5a2b03d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/nsx/services/vpc/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,12 @@ func (s *VPCService) CreateOrUpdateVPC(obj *v1alpha1.NetworkInfo) (*model.Vpc, *
return existingVPC[0], &nc, nil
}

vpcConnectivityProfile, err := s.NSXClient.VPCConnectivityProfilesClient.Get(nc.Org, nc.NSXProject, nc.VPCConnectivityProfile)
parts := strings.Split(nc.VPCConnectivityProfile, "/")
if len(parts) < 1 {
return nil, nil, fmt.Errorf("invalid VPCConnectivityProfile path: %s", nc.VPCConnectivityProfile)
}
vpcConnectivityProfileName := parts[len(parts)-1]
vpcConnectivityProfile, err := s.NSXClient.VPCConnectivityProfilesClient.Get(nc.Org, nc.NSXProject, vpcConnectivityProfileName)
if err != nil {
log.Error(err, "failed to get NSX VPC ConnectivityProfile object")
return nil, nil, err
Expand Down

0 comments on commit 5a2b03d

Please sign in to comment.