code: func WaitForScaleHasDesiredReplicas(sClient scaleclient.ScalesGetter, gr schema.GroupResource, resourceName string, namespace string, newSize uint, waitForReplicas *RetryParams) error {
  	if waitForReplicas == nil {
  		return fmt.Errorf("waitForReplicas parameter cannot be nil")
  	}
  	err := wait.PollImmediate(
  		waitForReplicas.Interval,
  		waitForReplicas.Timeout,
  		scaleHasDesiredReplicas(sClient, gr, resourceName, namespace, int32(newSize)))
  	if err == wait.ErrWaitTimeout {
  		return fmt.Errorf("timed out waiting for %q to be synced", resourceName)
  	}
  	return err
  }
docs: // WaitForScaleHasDesiredReplicas waits until condition scaleHasDesiredReplicas is satisfied
  // or returns error when timeout happens