mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Initialize default attach func regardless of the value of flag
This commit is contained in:
parent
0f60241eae
commit
acbbaddada
@ -213,14 +213,15 @@ func (o *DebugOptions) Complete(restClientGetter genericclioptions.RESTClientGet
|
|||||||
attachFlag := cmd.Flags().Lookup("attach")
|
attachFlag := cmd.Flags().Lookup("attach")
|
||||||
if !attachFlag.Changed && o.Interactive {
|
if !attachFlag.Changed && o.Interactive {
|
||||||
o.Attach = true
|
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
|
// Downstream tools may want to use their own customized
|
||||||
// handleAttachPod. But if this function is not set explicitly,
|
// attach function to do extra work or use attach command
|
||||||
// we fall back to default.
|
// with different flags instead of the static one defined in
|
||||||
if o.AttachFunc == nil {
|
// handleAttachPod. But if this function is not set explicitly,
|
||||||
o.AttachFunc = o.handleAttachPod
|
// we fall back to default.
|
||||||
}
|
if o.AttachFunc == nil {
|
||||||
|
o.AttachFunc = o.handleAttachPod
|
||||||
}
|
}
|
||||||
|
|
||||||
// Environment
|
// Environment
|
||||||
|
Loading…
Reference in New Issue
Block a user