omec-project / smf

9 stars 33 forks source link

fix: updates upf configuration when there's a modification #202

Closed gruyaume closed 8 months ago

gruyaume commented 9 months ago

Description

The SMF has an issue where where it was not possible to add a device group to an empty network slice. There were two root causes that caused this problem:

  1. compareUPNodesConfigs used to return match = true which would cause UpdatedSmfConfig.ModUPNodes to not contain the updated upf content. The changes for this are in factory/config.go.
  2. UpdateSmfUserPlaneNode would result in loosing the Links between the gNB and UPF. The reason was that this method would first delete and then create a new user plane object. The new user plane object would not contain the required Links because those are created by InsertUPNodeLinks only when there are changes to links (not on user plane change). Here instead of deleting the object, we simply edit it and maintain the existing Links. The changes for this are in context/user_plane_information.go.

Here I also added the necessary unit tests to validate the expected behavior of the modified methods.

Fixes #196

onf-bot commented 9 months ago

Can one of the admins verify this patch?

onf-bot commented 9 months ago

Can one of the admins verify this patch?

thakurajayL commented 9 months ago

ok to test

ghislainbourgeois commented 9 months ago

Also, can you please squash your commits?

gab-arrobo commented 9 months ago

Also, can you please squash your commits?

FYI, there is no need to squash the commits in the PR because they get squashed when the PR is merged (configured by default in the repos: Squash and merge image

gruyaume commented 8 months ago

@gab-arrobo can you please review this PR?

gab-arrobo commented 8 months ago

@gab-arrobo can you please review this PR?

@thakurajayL, did you have a chance to review this PR?