Fix wrong completion for kubectl attach

Although `kubectl attach POD_NAME <tab>` completes container name,
kubectl attach needs `-c` option so the command causes error as:

```
$ kubectl attach nginx-7cdbd8cdc9-b5rhr nginx
error: the server doesn't have a resource type "nginx-7cdbd8cdc9-b5rhr"
```

This patch changes the completion to the same way as `kubectl exec`.
pull/564/head
Kenjiro Nakayama 2018-12-31 13:28:32 +09:00
parent 13e59ab9ad
commit f7aca76bac
1 changed files with 2 additions and 2 deletions

View File

@ -248,11 +248,11 @@ __custom_func() {
__kubectl_get_resource
return
;;
kubectl_logs | kubectl_attach)
kubectl_logs)
__kubectl_require_pod_and_container
return
;;
kubectl_exec | kubectl_port-forward | kubectl_top_pod)
kubectl_exec | kubectl_port-forward | kubectl_top_pod | kubectl_attach)
__kubectl_get_resource_pod
return
;;