lburgazzoli commented on a change in pull request #784: Refactor controller 
logic
URL: https://github.com/apache/camel-k/pull/784#discussion_r299433515
 
 

 ##########
 File path: pkg/controller/integration/integration_controller.go
 ##########
 @@ -235,22 +237,63 @@ func (r *ReconcileIntegration) Reconcile(request 
reconcile.Request) (reconcile.R
                instance.Status.Phase = v1alpha1.IntegrationPhaseDeleting
        }
 
-       ilog := rlog.ForIntegration(instance)
-       for _, a := range integrationActionPool {
+       var targetPhase v1alpha1.IntegrationPhase
+       var err error
+
+       target := instance.DeepCopy()
+       targetLog := rlog.ForIntegration(target)
+
+       for _, a := range actions {
                a.InjectClient(r.client)
-               a.InjectLogger(ilog)
-               if a.CanHandle(instance) {
-                       ilog.Infof("Invoking action %s", a.Name())
-                       if err := a.Handle(ctx, instance); err != nil {
-                               if k8serrors.IsConflict(err) {
-                                       ilog.Error(err, "conflict")
+               a.InjectLogger(targetLog)
+
+               if a.CanHandle(target) {
+                       targetLog.Infof("Invoking action %s", a.Name())
+
+                       phaseFrom := target.Status.Phase
+
+                       target, err = a.Handle(ctx, target)
+                       if err != nil {
+                               return reconcile.Result{
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to