squakez commented on code in PR #3480:
URL: https://github.com/apache/camel-k/pull/3480#discussion_r929759016


##########
pkg/controller/integration/integration_controller.go:
##########
@@ -75,6 +77,109 @@ func newReconciler(mgr manager.Manager, c client.Client) 
reconcile.Reconciler {
        )
 }
 
+func integrationUpdateFunc(old *v1.Integration, it *v1.Integration) bool {

Review Comment:
   +1 for encapsulating these functions. However, I could not understand if 
there is any logic change in them or it was just the encapsulation which 
changed. Can you clarify?



##########
pkg/controller/integration/kits.go:
##########
@@ -82,6 +82,18 @@ func lookupKitsForIntegration(ctx context.Context, c 
ctrl.Reader, integration *v
        return kits, nil
 }
 
+// sameOrMatch returns whether the v1.IntegrationKit ios the one used by the 
v1.Integration or if it meets the
+// requirements of the v1.Integration.
+func sameOrMatch(kit *v1.IntegrationKit, integration *v1.Integration) (bool, 
error) {
+       if integration.Status.IntegrationKit != nil {
+               if integration.Status.IntegrationKit.Namespace == kit.Namespace 
&& integration.Status.IntegrationKit.Name == kit.Name {
+                       return true, nil
+               }
+       }
+
+       return integrationMatches(integration, kit)

Review Comment:
   I've just fixed another possibly related issue here #3487. In that case it 
was failing because the `match` always returned false when an IntegrationKit 
was on error. Not sure if there is any check in the `integrationMatches` that 
is influencing the failure here, and if it makes sense to revisit it. I'd 
expect the `integrationMatches` to take care of those new added conditions as 
well.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to