attach: Move the AttachFunc default function to the initializer

Fixes a partially constructed AttachOptions
pull/8/head
Ryan Phillips 2018-08-20 14:08:54 -05:00
parent e9de06d4df
commit 9abe17f0a0
1 changed files with 2 additions and 3 deletions

View File

@ -90,6 +90,7 @@ func NewAttachOptions(streams genericclioptions.IOStreams) *AttachOptions {
IOStreams: streams,
},
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()
}