Scheme *runtime.Scheme
}
+func (r *RicPlatformReconciler) handle_deploy_using_generated_go_code(usage string) {
+ // return
+ if usage == "create" {
+ r.CreateAll()
+ } else {
+ r.DeleteAll()
+ }
+}
+
//+kubebuilder:rbac:groups=ricdeploy.ricplt.com,resources=ricplatforms,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=ricdeploy.ricplt.com,resources=ricplatforms/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=ricdeploy.ricplt.com,resources=ricplatforms/finalizers,verbs=update
if instance.ObjectMeta.DeletionTimestamp.IsZero() {
// Adding a Finaliser also adds the DeletionTimestamp while deleting
if !controllerutil.ContainsFinalizer(instance, myFinalizerName) {
+ logger.Info("--- Job is in Creation state")
+ //r.get_replicas(logger, "intent-config", instance)
+ 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
} else {
// The object is being deleted
if controllerutil.ContainsFinalizer(instance, myFinalizerName) {
+ logger.Info("--- Job is in Deletion state")
+ r.handle_deploy_using_generated_go_code("delete")
+ logger.Info("--- Job has been Delete")
// remove our finalizer from the list and update it.
controllerutil.RemoveFinalizer(instance, myFinalizerName)
if err := r.Update(ctx, instance); err != nil {