From 6a6ed19133f0c38c9824b74c66d6e2a116bdd3e1 Mon Sep 17 00:00:00 2001 From: "naman.gupta" Date: Thu, 9 Nov 2023 01:16:46 +0530 Subject: [PATCH] Creation of all the resources of the xapp. Creation of all the resources of xapp. Change-Id: I89aa5cb25db934e59d29fc1225797cf109daa0cf Signed-off-by: naman.gupta --- xappKubernetesOperator/internal/controller/xappdep_controller.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.16.6