Merge pull request #122447 from ardaguclu/fix-debug-attach
Initialize default attach func regardless of the value of flag
This commit is contained in:
		@@ -213,6 +213,8 @@ 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
 | 
			
		||||
@@ -221,7 +223,6 @@ func (o *DebugOptions) Complete(restClientGetter genericclioptions.RESTClientGet
 | 
			
		||||
	if o.AttachFunc == nil {
 | 
			
		||||
		o.AttachFunc = o.handleAttachPod
 | 
			
		||||
	}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Environment
 | 
			
		||||
	envStrings, err := cmd.Flags().GetStringToString("env")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user