@Override
  public UpgradeCheckResult perform(UpgradeCheckRequest request) throws AmbariException {
    UpgradeCheckResult result = new UpgradeCheckResult(this);

    final String clusterName = request.getClusterName();
    final Cluster cluster = clustersProvider.get().getCluster(clusterName);
    Map<String, Service> services = cluster.getServices();
    List<String> errorMessages = new ArrayList<>();
    for (Service service : services.values()) {
      validateService(service, result, errorMessages);
    }

    if (!result.getFailedOn().isEmpty()) {
      result.setStatus(UpgradeCheckStatus.WARNING);
      String failReason = getFailReason(result, request);
      result.setFailReason(String.format(failReason, StringUtils.join(errorMessages, "\n")));
      result.setFailReason(StringUtils.join(errorMessages, "\n"));
    }

    return result;
  }
Warns about host components whose upgrade state is VERSION_MISMATCH. Never triggers
fail. In failure description, lists actual and expected component versions.
ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java