Skip to content

Commit

Permalink
oc debug fix crash on attach
Browse files Browse the repository at this point in the history
Refactors to pick up the initializer for defaultAttachFunc

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1618522
  • Loading branch information
rphillips committed Aug 22, 2018
1 parent c0a906d commit b051e60
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pkg/oc/cli/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down

0 comments on commit b051e60

Please sign in to comment.