From b051e60cb042fd0c8f5967841660a0f01774874d Mon Sep 17 00:00:00 2001 From: Ryan Phillips Date: Mon, 20 Aug 2018 10:57:37 -0500 Subject: [PATCH] oc debug fix crash on attach Refactors to pick up the initializer for defaultAttachFunc Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1618522 --- pkg/oc/cli/debug/debug.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/oc/cli/debug/debug.go b/pkg/oc/cli/debug/debug.go index 4fe8a4b83c25..07ffa73310ab 100644 --- a/pkg/oc/cli/debug/debug.go +++ b/pkg/oc/cli/debug/debug.go @@ -139,21 +139,17 @@ 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{}, - }, - LogsForObject: polymorphichelpers.LogsForObjectFn, + Attach: *attachOpts, + LogsForObject: polymorphichelpers.LogsForObjectFn, } }