nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
104 stars 53 forks source link

Duplicate entries after rendering the final NFDeployment template #493

Open arora-sagar opened 8 months ago

arora-sagar commented 8 months ago

When trying the latest nfdeploy-fn there are duplicate entries in parametersRefs field. I think we should do a check in lists to avoid duplicate entries.

apiVersion: workload.nephio.org/v1alpha1
kind: NFDeployment
metadata: # kpt-merge: smf-example/smf-example
  name: smf-regional
  namespace: free5gc-cp
  annotations:
    internal.kpt.dev/upstream-identifier: 'workload.nephio.org|NFDeployment|smf-example|smf-example'
spec:
  provider: smf.free5gc.io
  interfaces:
  - name: n4
    ipv4:
      address: 172.1.1.254/24
      gateway: 172.1.1.1
    vlanID: 5
  networkInstances:
  - name: vpc-internal
    interfaces:
    - n4
  parametersRefs:
  - name: smf-regional-upf-edge01
    apiVersion: ref.nephio.org/v1alpha1
    kind: Config
  - name: smf-regional-upf-edge01
    apiVersion: ref.nephio.org/v1alpha1
    kind: Config
  - name: smf-regional-upf-edge01
    apiVersion: ref.nephio.org/v1alpha1
    kind: Config
  - name: smf-regional-upf-edge02
    apiVersion: ref.nephio.org/v1alpha1
    kind: Config
  - name: smf-regional-upf-edge02
    apiVersion: ref.nephio.org/v1alpha1
    kind: Config
  - name: smf-regional-upf-edge02
    apiVersion: ref.nephio.org/v1alpha1
    kind: Config
  capacity:
    maxDownlinkThroughput: "0"
    maxNFConnections: 5
    maxSessions: 500
    maxUplinkThroughput: "0"

To repoduce

Deploy free5gc smf function using R2 test-infra main branch.

electrocucaracha commented 8 months ago

This change removes the repeated nfdeploy-fn call which was affecting the process to generate SMF configuration file, but it's not fixing the duplication of parametersRefs

arora-sagar commented 7 months ago

@tliron @electrocucaracha Should we keep it open till the time it is fixed?

tliron commented 7 months ago

I think this is still open. We reverted the fix, so nfdeploy-fn is still not idempotent.