Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
ShouheiNishi committed Nov 28, 2023
1 parent 99798f6 commit de80de8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions internal/sbi/consumer/nf_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ func BuildNFInstance(ausfContext *ausf_context.AUSFContext) (profile nrf_managem
profile.NfInstanceId = ausfContext.NfId
profile.NfType = nrf_management.NFTypeAUSF
profile.NfStatus = nrf_management.NFStatusREGISTERED
if profile.Ipv4Addresses == nil {
profile.Ipv4Addresses = &[]string{}
}
*profile.Ipv4Addresses = append(*profile.Ipv4Addresses, ausfContext.RegisterIPv4)
profile.Ipv4Addresses = append(profile.Ipv4Addresses, ausfContext.RegisterIPv4)
services := []nrf_management.NFService{}
for _, nfService := range ausfContext.NfService {
services = append(services, nfService)
Expand Down
12 changes: 6 additions & 6 deletions internal/sbi/producer/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ func getUdmUrl(nrfUri string) string {
logger.UeAuthLog.Errorln("[Search UDM UEAU] ", err.Error())
} else if len(res.NfInstances) > 0 {
udmInstance := res.NfInstances[0]
if udmInstance.Ipv4Addresses != nil && len(*udmInstance.Ipv4Addresses) > 0 &&
udmInstance.NfServices != nil && len(*udmInstance.NfServices) > 0 {
ueauService := (*udmInstance.NfServices)[0]
ueauEndPoint := (*ueauService.IpEndPoints)[0]
if ueauEndPoint.Ipv4Address != nil && ueauEndPoint.Port != nil {
udmUrl = string(ueauService.Scheme) + "://" + *ueauEndPoint.Ipv4Address + ":" + strconv.Itoa(*ueauEndPoint.Port)
if len(udmInstance.Ipv4Addresses) > 0 &&
len(udmInstance.NfServices) > 0 {
ueauService := (udmInstance.NfServices)[0]
ueauEndPoint := (ueauService.IpEndPoints)[0]
if ueauEndPoint.Port != nil {
udmUrl = string(ueauService.Scheme) + "://" + ueauEndPoint.Ipv4Address + ":" + strconv.Itoa(*ueauEndPoint.Port)
}
}
} else {
Expand Down

0 comments on commit de80de8

Please sign in to comment.