code: func (precondition *ScalePrecondition) validate(scale *autoscalingv1.Scale) error {
  	if precondition.Size != -1 && int(scale.Spec.Replicas) != precondition.Size {
  		return PreconditionError{"replicas", strconv.Itoa(precondition.Size), strconv.Itoa(int(scale.Spec.Replicas))}
  	}
  	if len(precondition.ResourceVersion) > 0 && scale.ResourceVersion != precondition.ResourceVersion {
  		return PreconditionError{"resource version", precondition.ResourceVersion, scale.ResourceVersion}
  	}
  	return nil
  }
docs: // validateGeneric ensures that the preconditions match. Returns nil if they are valid, otherwise an error