This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 6822ea89720742ec9feba89a1158b6f0afe807f2
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Tue Nov 22 15:31:43 2022 +0100

    fix(e2e): debug test
---
 pkg/trait/container_probes_test.go | 15 ++++++++++++++-
 pkg/trait/health.go                |  4 ++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/pkg/trait/container_probes_test.go 
b/pkg/trait/container_probes_test.go
index 2a8355ebe..ea2185792 100644
--- a/pkg/trait/container_probes_test.go
+++ b/pkg/trait/container_probes_test.go
@@ -63,7 +63,11 @@ func TestProbesDependencies(t *testing.T) {
        integration := &v1.Integration{
                Spec: v1.IntegrationSpec{
                        Traits: v1.Traits{
-                               Health: &traitv1.HealthTrait{},
+                               Health: &traitv1.HealthTrait{
+                                       Trait: traitv1.Trait{
+                                               Enabled: pointer.Bool(true),
+                                       },
+                               },
                        },
                },
        }
@@ -82,6 +86,9 @@ func TestProbesOnDeployment(t *testing.T) {
                Spec: v1.IntegrationSpec{
                        Traits: v1.Traits{
                                Health: &traitv1.HealthTrait{
+                                       Trait: traitv1.Trait{
+                                               Enabled: pointer.Bool(true),
+                                       },
                                        LivenessProbeEnabled:  
pointer.Bool(true),
                                        ReadinessProbeEnabled: 
pointer.Bool(true),
                                        LivenessTimeout:       1234,
@@ -114,6 +121,9 @@ func TestProbesOnDeploymentWithCustomScheme(t *testing.T) {
                Spec: v1.IntegrationSpec{
                        Traits: v1.Traits{
                                Health: &traitv1.HealthTrait{
+                                       Trait: traitv1.Trait{
+                                               Enabled: pointer.Bool(true),
+                                       },
                                        LivenessProbeEnabled:  
pointer.Bool(true),
                                        ReadinessProbeEnabled: 
pointer.Bool(true),
                                        LivenessScheme:        "HTTPS",
@@ -154,6 +164,9 @@ func TestProbesOnKnativeService(t *testing.T) {
                                        },
                                },
                                Health: &traitv1.HealthTrait{
+                                       Trait: traitv1.Trait{
+                                               Enabled: pointer.Bool(true),
+                                       },
                                        LivenessProbeEnabled:  
pointer.Bool(true),
                                        ReadinessProbeEnabled: 
pointer.Bool(true),
                                        LivenessTimeout:       1234,
diff --git a/pkg/trait/health.go b/pkg/trait/health.go
index ba06fb10c..7eee33b3b 100644
--- a/pkg/trait/health.go
+++ b/pkg/trait/health.go
@@ -55,6 +55,10 @@ func (t *healthTrait) Configure(e *Environment) (bool, 
error) {
                return false, nil
        }
 
+       if !pointer.BoolDeref(t.Enabled, false) {
+               return false, nil
+       }
+
        return true, nil
 }
 

Reply via email to