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


##########
pkg/apis/camel/v1/trait/knative_service.go:
##########
@@ -26,6 +26,10 @@ package trait
 // +camel-k:trait=knative-service.
 type KnativeServiceTrait struct {
        Trait `property:",squash" json:",inline"`
+       // The annotations added to route.
+       // This can be used to set knative service specific annotations
+       // CLI usage example: -t 
"route.annotations.'haproxy.router.openshift.io/balance'=true"

Review Comment:
   ```suggestion
        // CLI usage example: -t 
"knative-service.annotations.'haproxy.router.openshift.io/balance'=true"
   ```



##########
pkg/trait/knative_service_test.go:
##########
@@ -512,3 +514,26 @@ func createKnativeServiceTestEnvironment(t *testing.T, 
trait *traitv1.KnativeSer
 
        return environment
 }
+func TestServiceAnnotation(t *testing.T) {
+       annotationsTest := 
map[string]string{"haproxy.router.openshift.io/balance": "true"}
+
+       environment := createTestRouteEnvironment(t, KnativeServiceTestName)
+       environment.Integration.Spec.Traits = v1.Traits{
+               Route: &traitv1.RouteTrait{

Review Comment:
   Why are you testing Route annotation? I think you need to test 
`KnativeServiceTrait` instead.



##########
pkg/trait/knative_service.go:
##########
@@ -175,6 +178,8 @@ func (t *knativeServiceTrait) getServiceFor(e *Environment) 
(*serving.Service, e
                for k, v := range e.Integration.Annotations {
                        serviceAnnotations[k] = v

Review Comment:
   Yes. We need to append the trait annotation after the Integration 
annotations are propagated.



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