code: func ScaleCondition(r Scaler, precondition *ScalePrecondition, namespace, name string, count uint) wait.ConditionFunc {
  	return func() (bool, error) {
  		err := r.ScaleSimple(namespace, name, precondition, count)
  		switch e, _ := err.(ScaleError); err.(type) {
  		case nil:
  			return true, nil
  		case ScaleError:
  			// if it's invalid we shouldn't keep waiting
  			if e.FailureType == ScaleUpdateInvalidFailure {
  				return false, err
  			}
  			if e.FailureType == ScaleUpdateFailure {
  				return false, nil
  			}
  		}
  		return false, err
  	}
  }
docs: // ScaleCondition is a closure around Scale that facilitates retries via util.wait