Skip to content

Commit

Permalink
UPSTREAM: <carry>: oc debug fix crash on attach
Browse files Browse the repository at this point in the history
o.AttachFunc is nil since we use our own custom `oc debug` command.
Attaching the defaultAttachFunc if nil fixes the crash and gives a
prompt.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1618522
  • Loading branch information
rphillips committed Aug 20, 2018
1 parent 70c96cb commit f67cf0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 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
3 changes: 2 additions & 1 deletion vendor/k8s.io/kubernetes/pkg/kubectl/cmd/attach.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f67cf0f

Please sign in to comment.