squakez commented on code in PR #3977: URL: https://github.com/apache/camel-k/pull/3977#discussion_r1082551286
########## 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: Misleading comment. According to the statement below, it should be in error phase. ########## 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: Nitpick... you know otherwise nobody will ever bother to fix it :) ########## 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: Ditto ########## script/gen_client.sh: ########## @@ -17,7 +17,7 @@ location=$(dirname $0) -unset GOPATH +#unset GOPATH Review Comment: If it not required, we better remove even the comment IMO ########## 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: is `v1alpha1i` what we really need? ########## script/Makefile: ########## @@ -212,7 +212,8 @@ codegen-tools-install: controller-gen @# We must force the installation to make sure we are using the correct version @# Note: as there is no --version in the tools, we cannot rely on cached local versions @echo "Installing k8s.io/code-generator tools with version $(CODEGEN_VERSION)" - go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION) + #go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION) + go install github.com/astefanutti/code-generator/cmd/applyconfiguration-gen@pr-144-install Review Comment: Do we already have a PR opened with those changes? My concern is that once we bump `CODEGEN_VERSION` we won't be aligned and potentially screw up things. -- 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