You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/11/17 09:36:58 UTC

[camel-k] 03/05: chore(health): Handle readiness probe call errors

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

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

commit 462f77420714fc58a6ea40671440f4e600f5559e
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Fri Nov 12 14:37:02 2021 +0100

    chore(health): Handle readiness probe call errors
---
 pkg/controller/integration/monitor.go | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pkg/controller/integration/monitor.go b/pkg/controller/integration/monitor.go
index 08ee93d..66c7d59 100644
--- a/pkg/controller/integration/monitor.go
+++ b/pkg/controller/integration/monitor.go
@@ -20,6 +20,7 @@ package integration
 import (
 	"context"
 	"encoding/json"
+	"errors"
 	"fmt"
 	"reflect"
 	"strconv"
@@ -372,8 +373,13 @@ func (action *monitorAction) updateIntegrationPhaseAndReadyCondition(ctx context
 			if err == nil {
 				continue
 			}
+			if errors.Is(err, context.DeadlineExceeded) {
+				runtimeNotReadyMessages = append(runtimeNotReadyMessages, fmt.Sprintf("readiness probe timed out for Pod %s/%s", pod.Namespace, pod.Name))
+				continue
+			}
 			if !k8serrors.IsServiceUnavailable(err) {
-				return err
+				runtimeNotReadyMessages = append(runtimeNotReadyMessages, fmt.Sprintf("readiness probe failed for Pod %s/%s: %s", pod.Namespace, pod.Name, err.Error()))
+				continue
 			}
 			health := HealthCheck{}
 			err = json.Unmarshal(body, &health)