k3s/pkg/printers
Kubernetes Submit Queue 41c95725b4
Merge pull request #65463 from smarterclayton/jobs_output
Automatic merge from submit-queue (batch tested with PRs 64575, 65120, 65463, 65434, 65522). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve job describe and get output

For get, condense completions and success into a single column, and
print the job duration. Use a new variant of ShortHumanDuration that
shows more significant digits, since duration matters more for jobs.

```
NAME                                   COMPLETIONS   DURATION   AGE
image-mirror-origin-v3.10-1529985600   1/1           47s        42m
image-mirror-origin-v3.11-1529985600   1/1           74s        42m
image-pruner-1529971200                1/1           60m        4h
```

The completions column can be:

```
COMPLETIONS
0/1        # completions nil or 1, succeeded 0
1/1        # completions nil or 1, succeeded 1
0/3        # completions 3, succeeded 1
1/3        # completions 3, succeeded 1
0/1 of 30  # parallelism of 30, completions is nil
```

Update describe to show the completion time and the duration.

```
Start Time:     Mon, 25 Jun 2018 20:00:05 -0400
Completed At:   Mon, 25 Jun 2018 21:00:34 -0400
Duration:       60m
```

This is more useful than the current output:

```
NAME                                   DESIRED   SUCCESSFUL   AGE
image-mirror-origin-v3.10-1529982000   1         1            54m
image-mirror-origin-v3.11-1529982000   1         1            54m
image-pruner-1529971200                1         1            3h
```

```release-note
Improve the display of jobs in `kubectl get` and `kubectl describe` to emphasize progress and duration.
```
2018-06-28 02:20:20 -07:00
..
internalversion Merge pull request #65463 from smarterclayton/jobs_output 2018-06-28 02:20:20 -07:00
storage Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
.import-restrictions Restrict imports for printers 2017-02-23 00:28:31 -05:00
BUILD Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
OWNERS Add pkg/printers OWNERS 2017-03-07 22:28:27 -05:00
customcolumn.go move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
customcolumn_flags.go fix kubectl -o 2018-06-05 19:49:07 +08:00
customcolumn_flags_test.go move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
customcolumn_test.go move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
humanreadable.go Fix up legacy printer table adapter 2018-06-07 13:20:04 -04:00
humanreadable_test.go use subtest for table units (pkg/printers) 2018-05-14 15:11:48 +08:00
interface.go slim down printer interface 2018-05-04 11:15:35 -04:00
jsonpath.go marshal bytes to return as string with `kubectl config view -o jsonpath` 2018-06-13 15:25:34 -04:00
jsonpath_flags.go fix kubectl -o 2018-06-05 19:49:07 +08:00
jsonpath_flags_test.go move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
kube_template_flags.go fix kubectl -o 2018-06-05 19:49:07 +08:00
tabwriter.go
template.go move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
template_flags.go fix kubectl -o 2018-06-05 19:49:07 +08:00
template_flags_test.go move PrintOptions to genericclioptions 2018-05-21 14:59:41 -04:00
template_test.go use subtest for table units (pkg/printers) 2018-05-14 15:11:48 +08:00