lburgazzoli commented on code in PR #3977:
URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082588522


##########
e2e/global/common/traits/health_test.go:
##########
@@ -104,20 +106,190 @@ func TestHealthTrait(t *testing.T) {
                        //
                        Eventually(IntegrationCondition(ns, name, 
v1.IntegrationConditionReady), TestTimeoutLong).Should(And(
                                WithTransform(IntegrationConditionReason, 
Equal(v1.IntegrationConditionRuntimeNotReadyReason)),
-                               WithTransform(IntegrationConditionMessage, 
HavePrefix(
-                                       fmt.Sprintf(
-                                               "[Pod %s runtime is not ready: 
map[check.kind:READINESS route.id:route1 route.status:Stopped]",
-                                               pod.Name))),
-                       ))
+                               WithTransform(IntegrationConditionMessage, 
Equal("1/1 pods are not ready"))))
+
+                       Eventually(IntegrationCondition(ns, name, 
v1.IntegrationConditionReady), TestTimeoutLong).Should(
+                               Satisfy(func(c *v1.IntegrationCondition) bool {
+                                       if c.Status != corev1.ConditionFalse {
+                                               return false
+                                       }
+                                       if len(c.Pods) != 1 {
+                                               return false
+                                       }
+
+                                       var r *v1.HealthCheckResponse
+
+                                       for h := range c.Pods[0].Health {
+                                               if c.Pods[0].Health[h].Name == 
"camel-routes" {
+                                                       r = &c.Pods[0].Health[h]
+                                               }
+                                       }
+
+                                       if r == nil {
+                                               return false
+                                       }
+
+                                       if r.Data == nil {
+                                               return false
+                                       }
+
+                                       var data map[string]interface{}
+                                       if err := json.Unmarshal(r.Data, 
&data); err != nil {
+                                               return false
+                                       }
+
+                                       return data["check.kind"].(string) == 
"READINESS" && data["route.status"].(string) == "Stopped"
+                               }))
+
                        // Check the Integration is still in running phase

Review Comment:
   done



##########
pkg/apis/camel/v1/integration_types.go:
##########
@@ -262,6 +262,8 @@ type IntegrationCondition struct {
        Reason string `json:"reason,omitempty"`
        // A human-readable message indicating details about the transition.
        Message string `json:"message,omitempty"`
+       // TODO: add documentation

Review Comment:
   done



##########
pkg/apis/camel/v1alpha1/kamelet_binding_types.go:
##########
@@ -120,6 +120,8 @@ type KameletBindingCondition struct {
        Reason string `json:"reason,omitempty"`
        // A human readable message indicating details about the transition.
        Message string `json:"message,omitempty"`
+       // TODO: add documentation

Review Comment:
   done



##########
script/gen_client.sh:
##########
@@ -26,7 +26,7 @@ cd $location/../pkg/client/camel
 echo "Generating Go client code..."
 
 $(go env GOPATH)/bin/applyconfiguration-gen \
-       
--input-dirs=github.com/apache/camel-k/pkg/apis/camel/v1,github.com/apache/camel-k/pkg/apis/camel/v1alpha1
 \
+       
--input-dirs=github.com/apache/camel-k/pkg/apis/camel/v1,github.com/apache/camel-k/pkg/apis/camel/v1alpha1i,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1
 \

Review Comment:
   done



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