From def56a58a5c366ebe6366c6a241cc2e7f600c5ab Mon Sep 17 00:00:00 2001 From: Aldo Culquicondor Date: Wed, 8 Sep 2021 14:31:59 -0400 Subject: [PATCH] Add ready field to Job status to keep a count of the pods that have the ready condition. Also: - Add feature gate JobReadyPods. - Add Ready to describe. Change-Id: Ib934730a430a8e2a2f485671e345fe2330006939 Kubernetes-commit: 1bff5eb44d9897e12aff3ea10f5a856580158278 --- pkg/describe/describe.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/describe/describe.go b/pkg/describe/describe.go index d7901926..efdc64d4 100644 --- a/pkg/describe/describe.go +++ b/pkg/describe/describe.go @@ -2216,7 +2216,11 @@ func describeJob(job *batchv1.Job, events *corev1.EventList) (string, error) { if job.Spec.ActiveDeadlineSeconds != nil { w.Write(LEVEL_0, "Active Deadline Seconds:\t%ds\n", *job.Spec.ActiveDeadlineSeconds) } - w.Write(LEVEL_0, "Pods Statuses:\t%d Running / %d Succeeded / %d Failed\n", job.Status.Active, job.Status.Succeeded, job.Status.Failed) + if job.Status.Ready == nil { + w.Write(LEVEL_0, "Pods Statuses:\t%d Active / %d Succeeded / %d Failed\n", job.Status.Active, job.Status.Succeeded, job.Status.Failed) + } else { + w.Write(LEVEL_0, "Pods Statuses:\t%d Active (%d Ready) / %d Succeeded / %d Failed\n", job.Status.Active, *job.Status.Ready, job.Status.Succeeded, job.Status.Failed) + } if job.Spec.CompletionMode != nil && *job.Spec.CompletionMode == batchv1.IndexedCompletion { w.Write(LEVEL_0, "Completed Indexes:\t%s\n", capIndexesListOrNone(job.Status.CompletedIndexes, 50)) }