From 9abe17f0a01b7a9222e15d45d28f015004b3610d Mon Sep 17 00:00:00 2001 From: Ryan Phillips Date: Mon, 20 Aug 2018 14:08:54 -0500 Subject: [PATCH] attach: Move the AttachFunc default function to the initializer Fixes a partially constructed AttachOptions --- pkg/kubectl/cmd/attach.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/kubectl/cmd/attach.go b/pkg/kubectl/cmd/attach.go index fc409fd06bb..258b9b98050 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() }