nicolaferraro commented on a change in pull request #76: Context handling 
improvement
URL: https://github.com/apache/camel-k/pull/76#discussion_r217885307
 
 

 ##########
 File path: pkg/stub/action/integration/util.go
 ##########
 @@ -24,7 +25,81 @@ func LookupContextForIntegration(integration 
*v1alpha1.Integration) (*v1alpha1.I
                return &ctx, nil
        }
 
-       return nil, nil
+       ctxList := v1alpha1.NewIntegrationContextList()
+       if err := sdk.List(integration.Namespace, &ctxList); err != nil {
+               return nil, err
+       }
+
+       var c *v1alpha1.IntegrationContext
+
+       if len(integration.Spec.Dependencies) == 0 {
+               // The integration has no dependencies, try to find the one that
+               // has minimum dependencies requirement.
+
+               ndeps := math.MaxUint16
 
 Review comment:
   The final rule should be:
   - Take "X" if has the same set of dependencies
   - If no context has the same set, then create a context from the most 
similar one (advanced) or just create a new one
   - Don't use context "Y" if there is even just 1 library in "Y" that is not 
required by the integration (a.k.a. don't put unrelated garbage in the JVM)
   
   Wdyt?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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