code: func (r *RollingUpdater) getOrCreateTargetControllerWithClient(controller *corev1.ReplicationController, sourceID string) (*corev1.ReplicationController, bool, error) {
  	existingRc, err := r.existingController(controller)
  	if err != nil {
  		if !errors.IsNotFound(err) {
  			// There was an error trying to find the controller; don't assume we
  			// should create it.
  			return nil, false, err
  		}
  		if valOrZero(controller.Spec.Replicas) <= 0 {
  			return nil, false, fmt.Errorf("Invalid controller spec for %s; required: > 0 replicas, actual: %d", controller.Name, valOrZero(controller.Spec.Replicas))
  		}
  		// The controller wasn't found, so create it.
  		if controller.Annotations == nil {
  			controller.Annotations = map[string]string{}
  		}
  		controller.Annotations[desiredReplicasAnnotation] = fmt.Sprintf("%d", valOrZero(controller.Spec.Replicas))
  		controller.Annotations[sourceIDAnnotation] = sourceID
  		controller.Spec.Replicas = utilpointer.Int32Ptr(0)
  		newRc, err := r.rcClient.ReplicationControllers(r.ns).Create(controller)
  		return newRc, false, err
  	}
  	// Validate and use the existing controller.
  	annotations := existingRc.Annotations
  	source := annotations[sourceIDAnnotation]
  	_, ok := annotations[desiredReplicasAnnotation]
  	if source != sourceID || !ok {
  		return nil, false, fmt.Errorf("Missing/unexpected annotations for controller %s, expected %s : %s", controller.Name, sourceID, annotations)
  	}
  	return existingRc, true, nil
  }
docs: // getOrCreateTargetControllerWithClient looks for an existing controller with
  // sourceID. If found, the existing controller is returned with true
  // indicating that the controller already exists. If the controller isn't
  // found, a new one is created and returned along with false indicating the
  // controller was created.
  //
  // Existing controllers are validated to ensure their sourceIDAnnotation
  // matches sourceID; if there's a mismatch, an error is returned.