From 99cbad86512c92ee59f9b54a694323e7c79a4d20 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Tue, 19 Mar 2024 14:45:15 +0800 Subject: [PATCH] status --- pkg/controller/job-controller.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/controller/job-controller.go b/pkg/controller/job-controller.go index 705d4847aca..ddeec67c0a8 100644 --- a/pkg/controller/job-controller.go +++ b/pkg/controller/job-controller.go @@ -510,16 +510,22 @@ func (intervalJob *MinIOIntervalJob) getMinioJobStatus(ctx context.Context) v1al Message: command.Message, }) } else { - status.CommandsStatus = append(status.CommandsStatus, v1alpha1.CommandStatus{ - Name: command.JobName, - Result: "failed", - Message: command.Message, - }) failed = true message = command.Message // if success is false and message is empty, it means the job is running if command.Message == "" { running = true + status.CommandsStatus = append(status.CommandsStatus, v1alpha1.CommandStatus{ + Name: command.JobName, + Result: "running", + Message: command.Message, + }) + } else { + status.CommandsStatus = append(status.CommandsStatus, v1alpha1.CommandStatus{ + Name: command.JobName, + Result: "failed", + Message: command.Message, + }) } } command.Locker.RUnlock()