From: naman.gupta Date: Wed, 8 Nov 2023 19:46:46 +0000 (+0530) Subject: Creation of all the resources of the xapp. X-Git-Tag: 2.1.1~7 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F12027%2F1;p=ric-plt%2Fricdms.git Creation of all the resources of the xapp. Creation of all the resources of xapp. Change-Id: I89aa5cb25db934e59d29fc1225797cf109daa0cf Signed-off-by: naman.gupta --- diff --git a/xappKubernetesOperator/internal/controller/xappdep_controller.go b/xappKubernetesOperator/internal/controller/xappdep_controller.go index 5bff8d5..74bb87a 100644 --- a/xappKubernetesOperator/internal/controller/xappdep_controller.go +++ b/xappKubernetesOperator/internal/controller/xappdep_controller.go @@ -35,6 +35,12 @@ type XappDepReconciler struct { Scheme *runtime.Scheme } +func (r *XappDepReconciler) handle_deploy_using_generated_go_code(usage string) { + // return + if usage == "create" { + r.CreateAll() +} + //+kubebuilder:rbac:groups=depxapp.xapp.com,resources=xappdeps,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=depxapp.xapp.com,resources=xappdeps/status,verbs=get;update;patch //+kubebuilder:rbac:groups=depxapp.xapp.com,resources=xappdeps/finalizers,verbs=update @@ -69,6 +75,9 @@ func (r *XappDepReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct // Adding a Finaliser also adds the DeletionTimestamp while deleting if !controllerutil.ContainsFinalizer(instance, myFinalizerName) { // Would Be Called only during CR-Creation + logger.Info("--- Job is in Creation state") + r.handle_deploy_using_generated_go_code("create") + logger.Info("--- Job has been Created") controllerutil.AddFinalizer(instance, myFinalizerName) if err := r.Update(ctx, instance); err != nil { return ctrl.Result{}, err