kubectl/pkg
Marc Khouzam cd245d2e22 Support completion for the <type>/<name> form
This commit teaches the shell completion logic how to handle the
<type>/<name> form for resource specification.

It also teaches the 'exec' command how to complete its '--container/-c'
flag using container names.

Also, for commands that work on pods, kubectl will now also suggest
completion choices of the form <type>/<name> for resource types that
contain pods (see below for more details).

The following commands can now have completion of the <type>/<name>
form. Commands that accept any resource type:

annotate
apply edit-last-applied
apply view-last-applied
delete
describe
edit
get
label
patch

Commands that accept a subset of resource types:

autoscale
expose
rollout history
rollout pause
rollout restart
rollout resume
rollout status
rollout undo
scale
taint

Commands that apply to resource types that contain pods:

attach
exec
logs
port-foward

For these last four commands, the possible resource types are now
included in the completion choices.  For example:
    kubectl exec d<TAB>
will suggest
    daemonsets/   deployments/

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: cf66f5c3cbd0a0e2f223af438ee4c6bc7e4a907c
2022-03-01 10:45:59 -05:00
..
apply Rename test/data directory to testdata 2019-10-31 13:40:02 -07:00
apps Move pkg/kubectl/apps to staging 2019-07-24 20:02:05 -07:00
cmd Support completion for the <type>/<name> form 2022-03-01 10:45:59 -05:00
describe support preemptionPolicy in describe 2022-03-15 17:52:15 +08:00
drain Generalize dry run verify to arbitrary query param 2022-03-09 14:51:50 +00:00
explain Fix printing control character in kubectl explain 2022-01-20 15:04:15 +01:00
generate Clean unused generators 2021-03-03 22:47:53 +01:00
metricsutil fix top node output format incorrect 2021-09-18 09:41:51 +08:00
polymorphichelpers cmd/kubectl: make 'kubectl logs' default to the first container when default container cannot be determined or found by annotations (#105964) 2022-01-07 09:40:41 +08:00
proxy kubectl proxy: append context host path to request path 2020-12-16 17:37:44 +01:00
rawhttp Close the used file 2021-06-03 15:36:20 +08:00
scale Support kubectl scale --dry-run=server|client 2020-03-30 17:33:15 -04:00
scheme Promote cronjob to batch/v1: kubectl sparse_test prune 2021-05-26 20:08:36 +08:00
util Support completion for the <type>/<name> form 2022-03-01 10:45:59 -05:00
validation Move pkg/kubectl/validation to staging 2019-06-26 12:56:28 -07:00