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


##########
pkg/controller/integration/kits.go:
##########
@@ -250,3 +256,17 @@ func matchesTrait(it map[string]interface{}, kt 
map[string]interface{}) bool {
        // perform exact match on the two trait maps
        return reflect.DeepEqual(it, kt)
 }
+
+func hasMatchingSources(it *v1.Integration, kit *v1.IntegrationKit) bool {
+       for _, itSource := range it.Sources() {
+               for _, ikSource := range kit.Spec.Sources {
+                       if itSource.Content == ikSource.Content {
+                               // found, let's move to the next one
+                               break
+                       }
+                       return false
+               }
+
+       }
+       return true

Review Comment:
   No, it is the other way around. If the integration has more sources than the 
kit, it will fail finding all of them equals in the kit. If the kit has more 
sources, then it's still okey as it may hold more tolerated by the integration. 
However this is a scenario which should never happen as in the native case 
(which is the only one where we include integration kit sources) we always have 
a single source in Integration and IntegrationKit.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to