code: func (o *SetResourcesOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
  	var err error
  
  	o.RecordFlags.Complete(cmd)
  	o.Recorder, err = o.RecordFlags.ToRecorder()
  	if err != nil {
  		return err
  	}
  
  	o.UpdatePodSpecForObject = polymorphichelpers.UpdatePodSpecForObjectFn
  	o.Output = cmdutil.GetFlagString(cmd, "output")
  	o.DryRun = cmdutil.GetDryRunFlag(cmd)
  
  	if o.DryRun {
  		o.PrintFlags.Complete("%s (dry run)")
  	}
  	printer, err := o.PrintFlags.ToPrinter()
  	if err != nil {
  		return err
  	}
  	o.PrintObj = printer.PrintObj
  
  	cmdNamespace, enforceNamespace, err := f.ToRawKubeConfigLoader().Namespace()
  	if err != nil {
  		return err
  	}
  
  	builder := f.NewBuilder().
  		WithScheme(scheme.Scheme, scheme.Scheme.PrioritizedVersionsAllGroups()...).
  		LocalParam(o.Local).
  		ContinueOnError().
  		NamespaceParam(cmdNamespace).DefaultNamespace().
  		FilenameParam(enforceNamespace, &o.FilenameOptions).
  		Flatten()
  
  	if !o.Local {
  		builder.LabelSelectorParam(o.Selector).
  			ResourceTypeOrNameArgs(o.All, args...).
  			Latest()
  	} else {
  		// if a --local flag was provided, and a resource was specified in the form
  		// <resource>/<name>, fail immediately as --local cannot query the api server
  		// for the specified resource.
  		// TODO: this should be in the builder - if someone specifies tuples, fail when
  		// local is true
  		if len(args) > 0 {
  			return resource.LocalResourceError
  		}
  	}
  
  	o.Infos, err = builder.Do().Infos()
  	if err != nil {
  		return err
  	}
  	return nil
  }
docs: // Complete completes all required options