Commit bf5f69bf authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #18501 from feihujiang/printHowToReAttachToSession

Auto commit by PR queue bot
parents cd59d1e5 3a3421b7
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment