oc debug fix crash on attach
Refactors to pick up the initializer for defaultAttachFunc
Fixes
@@ -139,20 +139,16 @@ type DebugOptions struct {
}
func NewDebugOptions(streams genericclioptions.IOStreams) *DebugOptions {
+ attachOpts := kcmd.NewAttachOptions(streams)
+ attachOpts.TTY = true
+ attachOpts.Stdin = true
return &DebugOptions{
PrintFlags: genericclioptions.NewPrintFlags("").WithTypeSetter(scheme.Scheme),
IOStreams: streams,
Timeout: 15 * time.Minute,
KeepInitContainers: true,
AsUser: -1,
- Attach: kcmd.AttachOptions{
- StreamOptions: kcmd.StreamOptions{
- IOStreams: streams,
- TTY: true,
- Stdin: true,
- },
- Attach: &kcmd.DefaultRemoteAttach{},
- },
+ Attach: *attachOpts,
LogsForObject: polymorphichelpers.LogsForObjectFn,
}
}
