diff --git a/pkg/kubectl/cmd/attach.go b/pkg/kubectl/cmd/attach.go index adf0ae6d086..9ecaf4726dc 100644 --- a/pkg/kubectl/cmd/attach.go +++ b/pkg/kubectl/cmd/attach.go @@ -89,7 +89,8 @@ func NewAttachOptions(streams genericclioptions.IOStreams) *AttachOptions { StreamOptions: StreamOptions{ IOStreams: streams, }, - Attach: &DefaultRemoteAttach{}, + Attach: &DefaultRemoteAttach{}, + AttachFunc: defaultAttachFunc, } } @@ -193,8 +194,6 @@ func (o *AttachOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []s } o.Config = config - o.AttachFunc = defaultAttachFunc - if o.CommandName == "" { o.CommandName = cmd.CommandPath() }