• Kubernetes Submit Queue's avatar
    Merge pull request #37636 from… · e4abc36d
    Kubernetes Submit Queue authored
    Merge pull request #37636 from juanvallejo/jvallejo/bugfix/print-resource-kind-when-single-resource-type
    
    Automatic merge from submit-queue
    
    add resource prefix to multiple items w/ same kind
    
    **Release note**:
    ```release-note
    release-note-none
    ```
    
    This patch ensures that a resource prefix is added to multiple items of
    the same kind, when using `kubectl get all`. Before, a prefix was added only
    when a single item was returned on `kubectl get all`, but ignored if only a
    single resource kind existed but multiple items for that kind were
    returned.
    
    **Example**
    ```
    $ kubectl get all
    No resources found.
    
    $ kubectl create service loadbalancer testsvc1 --tcp=8080
    $ kubectl get all
    NAME               CLUSTER-IP       EXTERNAL-IP                     PORT(S)    AGE
    svc/testsvc1       172.30.119.220   172.46.100.155,172.46.100.155   8080/TCP   1h
    
    $ kubectl create service loadbalancer testsvc2 --tcp=8081
    $ kubectl get all
    NAME               CLUSTER-IP       EXTERNAL-IP                     PORT(S)    AGE
    svc/testsvc1       172.30.119.220   172.46.100.155,172.46.100.155   8080/TCP   1h
    svc/testsvc2       172.30.241.197   172.46.164.158,172.46.164.158   8081/TCP   1h
    ```
    
    @fabianofranz
    e4abc36d
helpers.go 23.7 KB