Skip to content

Commit

Permalink
Merge pull request #122452 from ardaguclu/automated-cherry-pick-of-#1…
Browse files Browse the repository at this point in the history
…22447-upstream-release-1.29

Automated cherry pick of #122447: Initialize default attach func regardless of the value of

Kubernetes-commit: ddcd83b30664637f13ca1d32c86c499d9ab21e1a
  • Loading branch information
k8s-publishing-bot committed Jan 10, 2024
2 parents 1fc5651 + 6b2d872 commit ed671f9
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 ed671f9

Please sign in to comment.