You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2019/10/14 09:05:38 UTC

[GitHub] [camel-k-runtime] nicolaferraro commented on a change in pull request #153: Support Knative broker/trigger model

nicolaferraro commented on a change in pull request #153: Support Knative broker/trigger model
URL: https://github.com/apache/camel-k-runtime/pull/153#discussion_r334383808
 
 

 ##########
 File path: camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/KnativeEnvironment.java
 ##########
 @@ -53,24 +53,24 @@ public KnativeEnvironment(
         return services.stream();
     }
 
-    public Optional<KnativeServiceDefinition> lookupService(Knative.Type type, String name, String... aliases) {
+    public Optional<KnativeServiceDefinition> lookupService(Knative.Kind endpointType, Knative.Type type, String name, String... aliases) {
         return Stream.concat(Stream.of(name), Stream.of(aliases))
             .sequential()
-            .map(n -> lookup(type, n))
+            .map(n -> lookup(endpointType, type, n))
             .filter(Optional::isPresent)
             .map(Optional::get)
             .findFirst();
     }
 
-    public KnativeServiceDefinition mandatoryLookupService(Knative.Type type, String name) {
-        return lookupService(type, name).orElseThrow(
+    public KnativeServiceDefinition mandatoryLookupService(Knative.Kind endpointType, Knative.Type type, String name) {
 
 Review comment:
   In case you want to add support for 4 fields lookup in this PR, `apiVersion` and (Kubernetes) `kind` are optional, so you should filter them only when explicitly set on the endpoint.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services