Orange-OpenSource / towards5gs-helm

Helm charts for deploying 5G network services on Kubernetes
Other
166 stars 130 forks source link

fix: setting for enable/disable ueransim tests #76

Closed mbaran0v closed 1 year ago

mbaran0v commented 1 year ago

Hello!

Thanks for your charts - they're great! But I found one problem - sometimes we need to install one chart for different namespaces, in this case - on the second install, helm cannot create the ClusterRole (because the role is already created on the first install)

run first installation:

$ helm upgrade --install ueransim towards5gs/ueransim --namespace test1 --version 2.0.15
Release "ueransim" does not exist. Installing it now.
NAME: ueransim
LAST DEPLOYED: Sun Mar 12 23:28:21 2023
NAMESPACE: test1
STATUS: deployed
REVISION: 1
NOTES:
...

run second installation:

$ helm upgrade --install ueransim towards5gs/ueransim --namespace test2 --version 2.0.15
Release "ueransim" does not exist. Installing it now.
Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "ueransim-test-connection" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "test2": current value is "test1"

for fix that, i added setting ue.test.enabled (default is true) - we can disable tests for next installations. This settings just minor change, not breaks compatibility

raoufkh commented 1 year ago

Hello @mbaran0v!

Thank you for the kind words and the contirubition.

Have you tried the latest version in the Github repo? I think that this issue has been resolved by #75. In fact, the best way to manage charts testing is based on annotations . In previous UERANSIM versions, the use of an errored annotation "halm.sh/hook": test instead of "helm.sh/hook": test resulted in creating k8s resources even if the user doesn't run the test with the helm test command. As the ClusterRole resource is not a namespaced resource, so it was created at each helm install command and this resulted in conflics. So please try with the latest version and let me know if it resolves this issue. Note that you should clean the ClusterRole resource manually if you're using a k8s cluster on which you installed older versions of UERANSIM chart.

kubectl delete clusterrole ueransim-test-connection
mbaran0v commented 1 year ago

@raoufkh thanks for answer - i will check it