mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	refactor builder in kubectl factory
This commit is contained in:
		@@ -122,19 +122,13 @@ func (o *SetLastAppliedOptions) Complete(f cmdutil.Factory, cmd *cobra.Command)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (o *SetLastAppliedOptions) Validate(f cmdutil.Factory, cmd *cobra.Command) error {
 | 
			
		||||
	mapper, typer, err := f.UnstructuredObject()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r := f.NewBuilder().
 | 
			
		||||
		Unstructured(f.UnstructuredClientForMapping, mapper, typer).
 | 
			
		||||
	r := f.NewUnstructuredBuilder().
 | 
			
		||||
		NamespaceParam(o.Namespace).DefaultNamespace().
 | 
			
		||||
		FilenameParam(o.EnforceNamespace, &o.FilenameOptions).
 | 
			
		||||
		Latest().
 | 
			
		||||
		Flatten().
 | 
			
		||||
		Do()
 | 
			
		||||
	err = r.Err()
 | 
			
		||||
	err := r.Err()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user