Skip to content

Commit

Permalink
status
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker committed Mar 19, 2024
1 parent 919e314 commit 99cbad8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pkg/controller/job-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 99cbad8

Please sign in to comment.