Merge pull request #24366 from janetkuo/kubectl-run-session-hint

Automatic merge from submit-queue

Fix session ended hint for kubectl run

Fixes #23602

Before:
```console
$ kubectl run -i --tty busybox --image=busybox 
Waiting for pod default/busybox-3797442026-mt8zk to be running, status is Pending, pod ready: false
Hit enter for command prompt
/ # 
/ # exit
Session ended, resume using ' busybox-3797442026-mt8zk -c busybox -i -t' command when the pod is running
                             ↑
                      (incomplete command)
```

After:
```console
Session ended, resume using 'kubectl attach busybox-3797442026-mt8zk -c busybox -i -t' command when the pod is running
```

@kubernetes/kubectl
pull/6/head
k8s-merge-robot 2016-04-20 00:30:23 -07:00
commit ebe4ce160e
1 changed files with 1 additions and 0 deletions

View File

@ -343,6 +343,7 @@ func handleAttachPod(f *cmdutil.Factory, c *client.Client, pod *api.Pod, opts *A
opts.Client = c
opts.PodName = pod.Name
opts.Namespace = pod.Namespace
opts.CommandName = "kubectl attach"
if err := opts.Run(); err != nil {
fmt.Fprintf(opts.Out, "Error attaching, falling back to logs: %v\n", err)
req, err := f.LogsForObject(pod, &api.PodLogOptions{Container: opts.GetContainerName(pod)})