code: func (r *RollingUpdater) scaleUp(newRc, oldRc *corev1.ReplicationController, desired, maxSurge, maxUnavailable int32, scaleRetryParams *RetryParams, config *RollingUpdaterConfig) (*corev1.ReplicationController, error) {
  	// If we're already at the desired, do nothing.
  	if valOrZero(newRc.Spec.Replicas) == desired {
  		return newRc, nil
  	}
  
  	// Scale up as far as we can based on the surge limit.
  	increment := (desired + maxSurge) - (valOrZero(oldRc.Spec.Replicas) + valOrZero(newRc.Spec.Replicas))
  	// If the old is already scaled down, go ahead and scale all the way up.
  	if valOrZero(oldRc.Spec.Replicas) == 0 {
  		increment = desired - valOrZero(newRc.Spec.Replicas)
  	}
  	// We can't scale up without violating the surge limit, so do nothing.
  	if increment <= 0 {
  		return newRc, nil
  	}
  	// Increase the replica count, and deal with fenceposts.
  	nextVal := valOrZero(newRc.Spec.Replicas) + increment
  	newRc.Spec.Replicas = &nextVal
  	if valOrZero(newRc.Spec.Replicas) > desired {
  		newRc.Spec.Replicas = &desired
  	}
  	// Perform the scale-up.
  	fmt.Fprintf(config.Out, "Scaling %s up to %d\n", newRc.Name, valOrZero(newRc.Spec.Replicas))
  	scaledRc, err := r.scaleAndWait(newRc, scaleRetryParams, scaleRetryParams)
  	if err != nil {
  		return nil, err
  	}
  	return scaledRc, nil
  }
docs: // scaleUp scales up newRc to desired by whatever increment is possible given
  // the configured surge threshold. scaleUp will safely no-op as necessary when
  // it detects redundancy or other relevant conditions.