Commit f73c6844 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #31383 from janetkuo/run-attach-err

Automatic merge from submit-queue Print to stderr when attach failed @kubernetes/kubectl
parents d5033c27 1d620b54
...@@ -479,7 +479,7 @@ func handleAttachPod(f *cmdutil.Factory, c *client.Client, ns, name string, opts ...@@ -479,7 +479,7 @@ func handleAttachPod(f *cmdutil.Factory, c *client.Client, ns, name string, opts
opts.PodName = name opts.PodName = name
opts.Namespace = ns opts.Namespace = ns
if err := opts.Run(); err != nil { if err := opts.Run(); err != nil {
fmt.Fprintf(opts.Out, "Error attaching, falling back to logs: %v\n", err) fmt.Fprintf(opts.Err, "Error attaching, falling back to logs: %v\n", err)
req, err := f.LogsForObject(pod, &api.PodLogOptions{Container: ctrName}) req, err := f.LogsForObject(pod, &api.PodLogOptions{Container: ctrName})
if err != nil { if err != nil {
return err return err
......
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