From 2aeb14772442d83daa2729cecec85deb50a709c8 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 a602526..a25a9f5 100644 --- a/pkg/health/health_flanksource.go +++ b/pkg/health/health_flanksource.go @@ -1,9 +1,11 @@ package health import ( + "fmt" "regexp" "strconv" + "github.com/samber/lo" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) @@ -27,7 +29,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, }