Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix free5GC tests and dedup SMF configrefs #48

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

tliron
Copy link
Contributor

@tliron tliron commented Feb 1, 2024

Also:

  • Update README to install ref.nephio.org Config
  • Upgrade to Go 1.21.6
  • Remove old and unused CRD files
  • Match AMF code style to that of the other NFs
  • Small fixes to log and error messages

README.md Outdated

```sh
git clone https://github.com/nephio-project/api
kubectl apply -f api/config/crd/bases/ref.nephio.org_configs.yaml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tliron we can do this instead

kubectl apply -f https://raw.githubusercontent.com/nephio-project/api/main/config/crd/bases/ref.nephio.org_configs.yaml 

kubectl apply -f https://raw.githubusercontent.com/nephio-project/api/main/config/crd/bases/workload.nephio.org_nfdeployments.yaml

kubectl apply -f https://github.com/nephio-project/api/blob/main/config/crd/bases/workload.nephio.org_nfconfigs.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... this is much better. Actually I should remove the CRD dupes from the free5gc repo! And also fix the Makefile to not install these dupes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tliron Don't we need multus definitions for testing the UPF?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I didn't change this from the original. Actually I didn't test that UPF works, only that it stands up.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then let's try it and then delete this part. I think for the block test we will need it.

spec:
config:
apiVersion: workload.nephio.org/v1alpha1
kind: NFDeployment
metadata:
name: free5gc-upf-1
namespace: upf-1
namespace: smf-1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi in the old version it was "free5gc-upf-1" should we keep UPF here? I think smf config has reference of the upf?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, the name and namespace are ignored. :) SMF just reads the other properties. However you are right that this is a UPF config, not an SMF config, so I will update.

Comment on lines 135 to 137
func createService(amdDeployment *nephiov1alpha1.NFDeployment) *apiv1.Service {
namespace := amdDeployment.Namespace
instanceName := amdDeployment.Name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func createService(amdDeployment *nephiov1alpha1.NFDeployment) *apiv1.Service {
namespace := amdDeployment.Namespace
instanceName := amdDeployment.Name
func createService(amfDeployment *nephiov1alpha1.NFDeployment) *apiv1.Service {
namespace := amfDeployment.Namespace
instanceName := amfDeployment.Name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops :)

@@ -172,7 +172,7 @@ func (r *AMFDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Reques
}
}
} else {
log.Error(err, fmt.Sprintf("Failed to create Deployment %s\n", err.Error()))
log.Error(err, fmt.Sprintf("Failed to create Deployment %s", err.Error()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Error(err, fmt.Sprintf("Failed to create Deployment %s", err.Error()))
log.Error(err, fmt.Sprintf("Failed to create AMF NFDeployment %s", err.Error()))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this log error is about failure to creating a K8s Deployment resource, I will keep the original.

Also:

* Update README to install ref.nephio.org Config
* Upgrade to Go 1.21.6
* Remove old and unused CRD files
* Match AMF code style to that of the other NFs
* Small fixes to log and error messages
@electrocucaracha
Copy link
Member

/lgtm

@s3wong
Copy link
Collaborator

s3wong commented Feb 1, 2024

/lgtm

@s3wong
Copy link
Collaborator

s3wong commented Feb 1, 2024

/approve

Copy link
Contributor

nephio-prow bot commented Feb 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: s3wong

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nephio-prow nephio-prow bot added the approved label Feb 1, 2024
@nephio-prow nephio-prow bot merged commit 9d77957 into nephio-project:main Feb 1, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants