Merge pull request #18501 from feihujiang/printHowToReAttachToSession

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2015-12-17 01:02:01 -08:00
commit bf5f69bf44

View File

@ -221,7 +221,14 @@ func (p *AttachOptions) Run() error {
TTY: tty,
}, api.Scheme)
return p.Attach.Attach("POST", req.URL(), p.Config, stdin, p.Out, p.Err, tty)
err = p.Attach.Attach("POST", req.URL(), p.Config, stdin, p.Out, p.Err, tty)
if err != nil {
return err
}
if p.Stdin && tty && pod.Spec.RestartPolicy == api.RestartPolicyAlways {
fmt.Fprintf(p.Out, "Session ended, resume using 'kubectl attach %s -c %s -i -t' command when the pod is running\n", pod.Name, containerToAttach.Name)
}
return nil
}
// GetContainer returns the container to attach to, with a fallback.