From 2b3939305fa58dbd5949e4391d1b0ffa97b6e7c5 Mon Sep 17 00:00:00 2001 From: Moshe Immermam Date: Sun, 1 Dec 2024 13:12:47 +0200 Subject: [PATCH] fix: cronjob message --- pkg/health/health_cronjob.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/health/health_cronjob.go b/pkg/health/health_cronjob.go index c362214..6cf4d34 100644 --- a/pkg/health/health_cronjob.go +++ b/pkg/health/health_cronjob.go @@ -42,7 +42,7 @@ func getBatchv1CronJobHealth(job *batchv1.CronJob) (*HealthStatus, error) { return &HealthStatus{ Health: HealthHealthy, Status: HealthStatusRunning, - Message: "Running since" + job.Status.LastScheduleTime.Format("2006-01-02 15:04:05 -0700"), + Message: "Running since " + job.Status.LastScheduleTime.Format("2006-01-02 15:04:05 -0700"), }, nil } @@ -51,7 +51,7 @@ func getBatchv1CronJobHealth(job *batchv1.CronJob) (*HealthStatus, error) { Ready: true, // The cronjob did in fact run Health: HealthUnhealthy, Status: HealthStatusError, - Message: "Last run failed, last successful run was" + job.Status.LastSuccessfulTime.Format( + Message: "Last run failed, last successful run was " + job.Status.LastSuccessfulTime.Format( "2006-01-02 15:04:05 -0700", ), }, nil @@ -62,7 +62,7 @@ func getBatchv1CronJobHealth(job *batchv1.CronJob) (*HealthStatus, error) { Health: HealthHealthy, Status: HealthStatusCompleted, Message: fmt.Sprintf( - "Last run at %s in %s", + "Last run at %s for %s", job.Status.LastScheduleTime.Format("2006-01-02 15:04:05 -0700"), job.Status.LastSuccessfulTime.Sub(job.Status.LastScheduleTime.Time), ),