• Kubernetes Submit Queue's avatar
    Merge pull request #66643 from smarterclayton/improve_events · f49708bd
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 66445, 66643, 60551). 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 the output of `kubectl get events`
    
    Events have long shown the most data of the core objects in their output, but that data is of varying use to a user. Following the principle that events are intended for the system to communicate information back to the user, and that Message is the primary human readable field, this commit alters the default columns to ensure event is shown with the most width given to the message, and all other fields organized by their relevance to the message.
    
    1. Events are no longer sorted in the printer (this was a bug and was broken with paging and server side rendering)
    2. Only the last seen, type, reason, kind, and message fields are shown by default, which makes the message prominent
    3. Source, subobject, count, and first seen are only shown under `-o wide`
    4. The duration fields were changed to be the more precise output introduced for job duration (2-3 sig figs)
    5. Prioritized the column order for scanning - when, how important, what kind of error, what kind of object, and the message.
    6. Trim trailing newlines on the message.
    
    ```release-note
    Improved the output of `kubectl get events` to prioritize showing the message, and move some fields to `-o wide`.
    ```
    
    ```
    $ kubectl get events --sort-by lastTimestamp
    LAST SEEN TYPE      REASON                   KIND                    MESSAGE
    16m       Normal    SawCompletedJob          CronJob                 Saw completed job: image-mirror-origin-v3.11-quay-1532581200
    16m       Normal    SuccessfulDelete         CronJob                 Deleted job image-mirror-origin-v3.11-quay-1532577600
    14m       Normal    Scheduled                Pod                     Successfully assigned 50c42204-9091-11e8-b2a1-0a58ac101869 to origin-ci-ig-n-fqfh
    14m       Normal    Pulling                  Pod                     pulling image "docker-registry.default.svc:5000/ci/commenter:latest"
    14m       Normal    Created                  Pod                     Created container
    14m       Normal    Pulled                   Pod                     Successfully pulled image "docker-registry.default.svc:5000/ci/commenter:latest"
    14m       Normal    Started                  Pod                     Started container
    14m       Normal    SandboxChanged           Pod                     Pod sandbox changed, it will be killed and re-created.
    4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
    4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
    4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
    4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
    4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
    4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
    4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
    4m13s     Normal    SuccessfulCreate         ReplicationController   Created pod: tide-30-hmncf
    4m13s     Normal    Scheduled                Pod                     Successfully assigned tide-30-hmncf to origin-ci-ig-n-x64l
    4m12s     Normal    SuccessfulCreate         ReplicationController   Created pod: console-jenkins-operator-16-dd5k8
    4m12s     Normal    SuccessfulCreate         ReplicationController   Created pod: sinker-23-scfmt
    ```
    f49708bd
Name
Last commit
Last update
..
internalversion Loading commit data...
storage Loading commit data...
.import-restrictions Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
customcolumn.go Loading commit data...
customcolumn_flags.go Loading commit data...
customcolumn_flags_test.go Loading commit data...
customcolumn_test.go Loading commit data...
humanreadable.go Loading commit data...
humanreadable_test.go Loading commit data...
interface.go Loading commit data...
tabwriter.go Loading commit data...