code: func (o *SetSelectorOptions) RunSelector() error {
  	r := o.ResourceFinder.Do()
  
  	return r.Visit(func(info *resource.Info, err error) error {
  		patch := &Patch{Info: info}
  		CalculatePatch(patch, scheme.DefaultJSONEncoder(), func(obj runtime.Object) ([]byte, error) {
  			selectErr := updateSelectorForObject(info.Object, *o.selector)
  			if selectErr != nil {
  				return nil, selectErr
  			}
  
  			// record this change (for rollout history)
  			if err := o.Recorder.Record(patch.Info.Object); err != nil {
  				klog.V(4).Infof("error recording current command: %v", err)
  			}
  
  			return runtime.Encode(scheme.DefaultJSONEncoder(), info.Object)
  		})
  
  		if patch.Err != nil {
  			return patch.Err
  		}
  		if !o.WriteToServer {
  			return o.PrintObj(info.Object, o.Out)
  		}
  
  		actual, err := resource.NewHelper(info.Client, info.Mapping).Patch(info.Namespace, info.Name, types.StrategicMergePatchType, patch.Patch, nil)
  		if err != nil {
  			return err
  		}
  
  		return o.PrintObj(actual, o.Out)
  	})
  }
docs: // RunSelector executes the command.