• Kubernetes Submit Queue's avatar
    Merge pull request #28352 from vefimova/fix_22986-1 · aedeccda
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    Added warning msg for `kubectl get`
    
    - added warning description regarding terminated pods to `get` long help message
      - added printing of warning message in case of `get pods` if there are hidden pods
    
    Fixes #22986  (initiall PR and discussion are here #26417)
    
    ## **Output examples:**
    ### # kubectl get pods
    ```
    NAME                       READY     STATUS             RESTARTS   AGE
    dapi-test-pod1             0/1       Terminating        0          22h
    liveness-http              0/1       CrashLoopBackOff   11245      22d
    ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2336       8d
      info: 1 completed object(s) was(were) not shown in pods list. Pass --show-all to see all objects.
    
    ```
    
    ### #  kubectl get pods,namespaces
    ```
    NAME                          READY     STATUS             RESTARTS   AGE
    po/dapi-test-pod1             0/1       Terminating        0          22h
    po/liveness-http              1/1       Running            11242      22d
    po/ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2335       8d
     info: 1 completed object(s) was(were) not shown in pods list. Pass --show-all to see all objects.
    
    NAME             STATUS    AGE
    ns/default       Active    89d
    ns/kube-system   Active    41d
    ```
    
    ### # kubectl get pods -a
    ```
    NAME                       READY     STATUS             RESTARTS   AGE
    busybox                    0/1       Error              0          27d
    dapi-test-pod1             0/1       Terminating        0          22h
    liveness-http              0/1       CrashLoopBackOff   11245      22d
    ubuntu1-1206318548-oh9tc   0/1       CrashLoopBackOff   2336       8d
    ```
    
    ### # kubectl get -h
    ```
    Display one or many resources.
    
    Possible resource types include (case insensitive): pods (aka 'po'), services (aka 'svc'), deployments (aka 'deploy'),
    replicasets (aka 'rs'), replicationcontrollers (aka 'rc'), nodes (aka 'no'), events (aka 'ev'), limitranges (aka 'limits'),
    persistentvolumes (aka 'pv'), persistentvolumeclaims (aka 'pvc'), resourcequotas (aka 'quota'), namespaces (aka 'ns'),
    serviceaccounts (aka 'sa'), ingresses (aka 'ing'), horizontalpodautoscalers (aka 'hpa'), daemonsets (aka 'ds'), configmaps (aka 'cm'),
    componentstatuses (aka 'cs), endpoints (aka 'ep'), petsets (alpha feature, may be unstable) and secrets.
    
    This command will hide resources that have completed. For instance, pods that are in the Succeeded or Failed phases.
    You can see the full results for any resource by providing the '--show-all' flag.
    
    By specifying the output as 'template' and providing a Go template as the value
    of the --template flag, you can filter the attributes of the fetched resource(s).
    
    Examples:
    
    .........
    ````
    aedeccda
Name
Last commit
Last update
..
cmd Loading commit data...
metricsutil Loading commit data...
resource Loading commit data...
testing Loading commit data...
OWNERS Loading commit data...
apply.go Loading commit data...
autoscale.go Loading commit data...
bash_comp_utils.go Loading commit data...
configmap.go Loading commit data...
configmap_test.go Loading commit data...
custom_column_printer.go Loading commit data...
custom_column_printer_test.go Loading commit data...
deployment.go Loading commit data...
deployment_test.go Loading commit data...
describe.go Loading commit data...
describe_test.go Loading commit data...
doc.go Loading commit data...
explain.go Loading commit data...
generate.go Loading commit data...
generate_test.go Loading commit data...
history.go Loading commit data...
interfaces.go Loading commit data...
kubectl.go Loading commit data...
kubectl_test.go Loading commit data...
namespace.go Loading commit data...
namespace_test.go Loading commit data...
proxy_server.go Loading commit data...
proxy_server_test.go Loading commit data...
quota.go Loading commit data...
quota_test.go Loading commit data...
resource_printer.go Loading commit data...
resource_printer_test.go Loading commit data...
rollback.go Loading commit data...
rolling_updater.go Loading commit data...
rolling_updater_test.go Loading commit data...
rollout_status.go Loading commit data...
run.go Loading commit data...
run_test.go Loading commit data...
scale.go Loading commit data...
scale_test.go Loading commit data...
secret.go Loading commit data...
secret_for_docker_registry.go Loading commit data...
secret_for_docker_registry_test.go Loading commit data...
secret_for_tls.go Loading commit data...
secret_for_tls_test.go Loading commit data...
secret_test.go Loading commit data...
service.go Loading commit data...
service_basic.go Loading commit data...
service_basic_test.go Loading commit data...
service_test.go Loading commit data...
serviceaccount.go Loading commit data...
serviceaccount_test.go Loading commit data...
sorted_event_list.go Loading commit data...
sorted_event_list_test.go Loading commit data...
sorted_resource_name_list.go Loading commit data...
sorted_resource_name_list_test.go Loading commit data...
sorting_printer.go Loading commit data...
sorting_printer_test.go Loading commit data...
stop.go Loading commit data...
stop_test.go Loading commit data...
version.go Loading commit data...
watchloop.go Loading commit data...