Files
kubernetes/pkg/kubectl/cmd
Kubernetes Submit Queue cecbbad128 Merge pull request #63914 from superbrothers/completion-init-containers
Automatic merge from submit-queue (batch tested with PRs 63914, 63887, 64116, 64026, 62933). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add initContainers into completion suggestions for kubectl logs/attach

**What this PR does / why we need it**: This PR improves autocomplete of kubectl logs/attach to add initContainers into completion suggestions in addition to containers.

```
$ cat <<EOL | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
spec:
  initContainers:
  - name: init-myservice
    image: busybox
    command: ['sh', '-c', 'until nslookup myservice; do echo waiting for myservice; sleep 2; done;']
  - name: init-mydb
    image: busybox
    command: ['sh', '-c', 'until nslookup mydb; do echo waiting for mydb; sleep 2; done;']
  containers:
  - name: myapp-container
    image: busybox
    command: ['sh', '-c', 'echo The app is running! && sleep 3600']
EOL
$ kubectl logs myapp-pod <tab><tab>
init-mydb        init-myservice   myapp-container
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-22 17:36:09 -07:00
..
2018-05-08 09:02:34 -04:00
2018-05-08 18:33:50 -04:00
2018-05-08 18:33:50 -04:00
2018-05-18 11:49:02 -04:00
2018-05-21 14:59:41 -04:00
2018-05-04 17:02:20 -04:00
2018-03-13 16:21:30 -04:00
2018-05-08 18:33:50 -04:00
2018-05-08 18:33:50 -04:00
2018-05-08 09:02:34 -04:00
2018-05-08 18:33:50 -04:00
2018-05-08 18:33:50 -04:00
2017-12-25 16:23:38 +08:00
2018-05-08 18:33:50 -04:00
2017-08-16 12:27:36 -07:00
2018-05-08 18:33:50 -04:00
2018-05-08 09:02:34 -04:00
2018-05-08 18:33:50 -04:00
2018-05-08 18:33:50 -04:00
2018-04-27 21:41:03 +02:00
2018-05-21 14:59:41 -04:00
2018-05-08 18:33:50 -04:00
2018-05-08 18:33:50 -04:00
2018-05-08 09:02:34 -04:00
2018-05-08 09:02:34 -04:00
2018-05-08 09:02:34 -04:00