code: func (o *SetServiceAccountOptions) Run() error {
  	patchErrs := []error{}
  	patchFn := func(obj runtime.Object) ([]byte, error) {
  		_, err := o.updatePodSpecForObject(obj, func(podSpec *v1.PodSpec) error {
  			podSpec.ServiceAccountName = o.serviceAccountName
  			return nil
  		})
  		if err != nil {
  			return nil, err
  		}
  		// record this change (for rollout history)
  		if err := o.Recorder.Record(obj); err != nil {
  			klog.V(4).Infof("error recording current command: %v", err)
  		}
  
  		return runtime.Encode(scheme.DefaultJSONEncoder(), obj)
  	}
  
  	patches := CalculatePatches(o.infos, scheme.DefaultJSONEncoder(), patchFn)
  	for _, patch := range patches {
  		info := patch.Info
  		name := info.ObjectName()
  		if patch.Err != nil {
  			patchErrs = append(patchErrs, fmt.Errorf("error: %s %v\n", name, patch.Err))
  			continue
  		}
  		if o.local || o.dryRun {
  			if err := o.PrintObj(info.Object, o.Out); err != nil {
  				patchErrs = append(patchErrs, err)
  			}
  			continue
  		}
  		actual, err := resource.NewHelper(info.Client, info.Mapping).Patch(info.Namespace, info.Name, types.StrategicMergePatchType, patch.Patch, nil)
  		if err != nil {
  			patchErrs = append(patchErrs, fmt.Errorf("failed to patch ServiceAccountName %v", err))
  			continue
  		}
  
  		if err := o.PrintObj(actual, o.Out); err != nil {
  			patchErrs = append(patchErrs, err)
  		}
  	}
  	return utilerrors.NewAggregate(patchErrs)
  }
docs: // Run creates and applies the patch either locally or calling apiserver.