diff --git a/pkg/kubectl/cmd/run.go b/pkg/kubectl/cmd/run.go index 17cd31ed180..82b6167ca39 100644 --- a/pkg/kubectl/cmd/run.go +++ b/pkg/kubectl/cmd/run.go @@ -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)})