Skip to content

Commit

Permalink
Initialize default attach func regardless of the value of flag
Browse files Browse the repository at this point in the history
Kubernetes-commit: cde050c4d0b02003d34f7056bd038fe8f4accc42
  • Loading branch information
ardaguclu authored and k8s-publishing-bot committed Dec 22, 2023
1 parent 1fc5651 commit 6b2d872
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/cmd/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,15 @@ func (o *DebugOptions) Complete(restClientGetter genericclioptions.RESTClientGet
attachFlag := cmd.Flags().Lookup("attach")
if !attachFlag.Changed && o.Interactive {
o.Attach = true
// Downstream tools may want to use their own customized
// attach function to do extra work or use attach command
// with different flags instead of the static one defined in
// handleAttachPod. But if this function is not set explicitly,
// we fall back to default.
if o.AttachFunc == nil {
o.AttachFunc = o.handleAttachPod
}
}

// Downstream tools may want to use their own customized
// attach function to do extra work or use attach command
// with different flags instead of the static one defined in
// handleAttachPod. But if this function is not set explicitly,
// we fall back to default.
if o.AttachFunc == nil {
o.AttachFunc = o.handleAttachPod
}

// Environment
Expand Down

0 comments on commit 6b2d872

Please sign in to comment.