• juanvallejo's avatar
    add linebreak between resource groups · 735fbf9c
    juanvallejo authored
    Printing multiple groups via `kubectl get all` can produce output that is
    hard to read in cases where there are a lot of resource types to display
    / some resource types contain varying column amounts.
    
    This patch adds a linebreak above each group of resources only when
    there is more than one group to display, and always omitting the
    linebreak above the first group. This makes for slightly improved
    output.
    
    Linebreaks are printed to stderr, and honor the `--no-headers` option.
    
    **Before**
    
    ```
    $ kubectl get all
    NAME                     READY     STATUS    RESTARTS   AGE
    po/database-1-u9m9l      1/1       Running   3          5d
    po/idling-echo-1-9fmz6   2/2       Running   8          5d
    po/idling-echo-1-gzb0v   2/2       Running   4          5d
    NAME               DESIRED   CURRENT   READY     AGE
    rc/database-1      1         1         1         6d
    rc/idling-echo-1   2         2         2         6d
    NAME              CLUSTER-IP       EXTERNAL-IP   PORT(S)
    AGE
    svc/database      172.30.11.104    <none>        5434/TCP
    6d
    svc/frontend      172.30.196.217   <none>        5432/TCP
    6d
    svc/idling-echo   172.30.115.67    <none>        8675/TCP,3090/UDP
    6d
    svc/kubernetes    172.30.0.1       <none>        443/TCP,53/UDP,53/TCP
    6d
    svc/mynodeport    172.30.81.254    <nodes>       8080/TCP
    5d
    svc/mynodeport1   172.30.198.193   <nodes>       8080/TCP
    5d
    svc/mynodeport2   172.30.149.48    <nodes>       8080/TCP
    5d
    svc/mynodeport3   172.30.195.235   <nodes>       8080/TCP
    5d
    ```
    
    **After**
    
    ```
    $ kubectl get all
    NAME                     READY     STATUS    RESTARTS   AGE
    po/database-1-u9m9l      1/1       Running   3          5d
    po/idling-echo-1-9fmz6   2/2       Running   8          5d
    po/idling-echo-1-gzb0v   2/2       Running   4          5d
    
    NAME               DESIRED   CURRENT   READY     AGE
    rc/database-1      1         1         1         6d
    rc/idling-echo-1   2         2         2         6d
    
    NAME              CLUSTER-IP       EXTERNAL-IP   PORT(S)
    AGE
    svc/database      172.30.11.104    <none>        5434/TCP
    6d
    svc/frontend      172.30.196.217   <none>        5432/TCP
    6d
    svc/idling-echo   172.30.115.67    <none>        8675/TCP,3090/UDP
    6d
    svc/kubernetes    172.30.0.1       <none>        443/TCP,53/UDP,53/TCP
    6d
    svc/mynodeport    172.30.81.254    <nodes>       8080/TCP
    5d
    svc/mynodeport1   172.30.198.193   <nodes>       8080/TCP
    5d
    svc/mynodeport2   172.30.149.48    <nodes>       8080/TCP
    5d
    svc/mynodeport3   172.30.195.235   <nodes>       8080/TCP
    5d
    ```
    735fbf9c
Name
Last commit
Last update
..
admission Loading commit data...
api Loading commit data...
apimachinery Loading commit data...
apis Loading commit data...
apiserver Loading commit data...
auth Loading commit data...
capabilities Loading commit data...
client Loading commit data...
cloudprovider Loading commit data...
controller Loading commit data...
conversion Loading commit data...
credentialprovider Loading commit data...
dns Loading commit data...
fieldpath Loading commit data...
fields Loading commit data...
generated Loading commit data...
genericapiserver Loading commit data...
healthz Loading commit data...
httplog Loading commit data...
hyperkube Loading commit data...
kubectl Loading commit data...
kubelet Loading commit data...
kubemark Loading commit data...
labels Loading commit data...
master Loading commit data...
metrics Loading commit data...
probe Loading commit data...
proxy Loading commit data...
quota Loading commit data...
registry Loading commit data...
routes Loading commit data...
runtime Loading commit data...
security Loading commit data...
securitycontext Loading commit data...
selection Loading commit data...
serviceaccount Loading commit data...
ssh Loading commit data...
storage Loading commit data...
types Loading commit data...
util Loading commit data...
version Loading commit data...
volume Loading commit data...
watch Loading commit data...
OWNERS Loading commit data...