kubectl/pkg/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
..
certificate Add v1 CSR support to kubectl describe 2020-06-04 12:05:51 -04:00
deployment Add --chunk-size support to kubectl describe 2021-04-20 11:24:35 -07:00
event Move pkg/kubectl/util/event into staging 2019-06-19 15:31:51 -07:00
fieldpath Move pkg/kubectl/util/fieldpath to staging 2019-06-19 17:13:57 -07:00
hash Immutable field and validation 2019-11-26 13:29:26 +01:00
i18n update translations 2021-07-06 20:43:49 +02:00
interrupt Moved pkg/kubectl/util/term, pkg/kubectl/util/templates, pkg/kubectl/util/interrupt, and pkg/kubectl/util/interrupt to staging 2019-06-19 16:31:38 +02:00
openapi remove go-openapi/spec 2021-04-20 17:48:33 +02:00
podutils kubectl: Inline the containers for the user in attach/exec 2021-02-11 11:40:25 -05:00
qos Delete duplicate resource.Quantity.Copy() 2019-08-19 17:23:14 -07:00
rbac When combining PolicyRules, don't duplicate verbs 2020-05-18 15:20:06 -04:00
resource Downward API hugepages 2020-11-06 14:22:53 -05:00
slice Move pkg/util/slice and update refs 2019-06-19 23:24:56 -04:00
storage Update helper methods to print and parse ReadWriteOncePod access mode 2021-03-10 20:51:43 -08:00
templates go1.14: fix gofmt errors 2020-06-23 15:06:11 -04:00
term generated: Run hack/update-gofmt.sh 2021-08-12 17:13:11 -04:00
apply.go Move pkg/kubectl/apply.go to staging 2019-07-24 20:40:25 -07:00
completion.go Complete multiple resource names 2021-10-15 15:36:09 -04:00
completion_test.go Complete multiple resource names 2021-10-15 15:36:09 -04:00
pod_port.go Move pkg/kubectl/util to staging 2019-07-24 11:59:28 -07:00
pod_port_test.go Move pkg/kubectl/util to staging 2019-07-24 11:59:28 -07:00
service_port.go Move pkg/kubectl/util to staging 2019-07-24 11:59:28 -07:00
service_port_test.go Move pkg/kubectl/util to staging 2019-07-24 11:59:28 -07:00
umask.go generated: Run hack/update-gofmt.sh 2021-08-12 17:13:11 -04:00
umask_windows.go generated: Run hack/update-gofmt.sh 2021-08-12 17:13:11 -04:00
util.go cleanup: fix some error log capitalization 2020-10-28 16:44:54 +08:00
util_test.go Move pkg/kubectl/util to staging 2019-07-24 11:59:28 -07:00