From b4d1ab30780f744bfda8af9e9454ecc2e10544cd Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Tue, 17 Dec 2024 14:16:06 +0545 Subject: [PATCH] feat: on canary health, set uptime --- pkg/health/health_flanksource.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/health/health_flanksource.go b/pkg/health/health_flanksource.go index b118618..be73caf 100644 --- a/pkg/health/health_flanksource.go +++ b/pkg/health/health_flanksource.go @@ -1,10 +1,12 @@ package health import ( + "fmt" "regexp" "strconv" "strings" + "github.com/samber/lo" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) @@ -28,7 +30,7 @@ func getCanaryHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { uptime1h, _, _ := unstructured.NestedString(obj.Object, "status", "uptime1h") output := HealthStatus{ - Message: message, + Message: lo.CoalesceOrEmpty(message, fmt.Sprintf("uptime: %s", uptime1h)), Status: HealthStatusCode(canaryStatus), Ready: true, }