kubectl/pkg/cmd/util
Marc Khouzam b111bee570 Complete multiple resource names
This commit teaches the completion function to repeat resource names
when supported by the command. The logic checks if a resource name
has already been specified by the user and does not include it again
when repeating the completion.

For example, the get command can receive multiple pods names, therefore
with this commit we have:
  kubectl get pod pod1 [tab]
will provide completion of pod names again, but not show 'pod1' since
it is already part of the command-line.

The improvement affects the following commands:
- annotate
- apply edit-last-applied
- apply view-last-applied
- autoscale
- delete
- describe
- edit
- expose
- get
- label
- patch
- rollout history
- rollout pause
- rollout restart
- rollout resume
- rollout undo
- scale
- taint

Note that "rollout status" only accepts a single resource name, unlike
the other "rollout ..." commands; this required the creation of a
special completion function that did not repeat just for that case.

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

Kubernetes-commit: 7aa5cb40316dbeb970250ee0835fbd597fd19a20
2021-10-15 15:36:09 -04:00
..
editor Use os.CreateTemp in kubectl editor (#99921) 2021-04-08 16:00:25 -07:00
podcmd kubectl: Inline the containers for the user in attach/exec 2021-02-11 11:40:25 -05:00
sanity Move pkg/kubectl/cmd/util and subdirs to staging 2019-07-28 21:29:36 -07:00
env_file.go Remove dependency of generators from create configmap 2021-01-10 18:47:32 -05:00
env_file_test.go Remove dependency of generators from create configmap 2021-01-10 18:47:32 -05:00
factory.go Cache the OpenAPI schema for server-side dry-run. 2021-01-19 16:36:14 -05:00
factory_client_access.go Cache the OpenAPI schema for server-side dry-run. 2021-01-19 16:36:14 -05:00
helpers.go Complete multiple resource names 2021-10-15 15:36:09 -04:00
helpers_test.go Complete multiple resource names 2021-10-15 15:36:09 -04:00
kubectl_match_version.go remove pkg/version and some of redundant copies of it 2019-09-10 14:42:55 -07:00
printing.go Move pkg/kubectl/cmd/util and subdirs to staging 2019-07-28 21:29:36 -07:00