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

    Set<String> osFamiliesInCluster = osFamiliesInCluster(cluster(request));
    if (!targetOsFamilies(request).containsAll(osFamiliesInCluster)) {
      result.setFailReason(getFailReason(TARGET_OS, result, request));
      result.setStatus(UpgradeCheckStatus.FAIL);
      result.setFailedOn(new LinkedHashSet<>(osFamiliesInCluster));
    } else if (!sourceOsFamilies(request).containsAll(osFamiliesInCluster)) {
      result.setFailReason(getFailReason(SOURCE_OS, result, request));
      result.setStatus(UpgradeCheckStatus.FAIL);
      result.setFailedOn(new LinkedHashSet<>(osFamiliesInCluster));
    }

    return result;
  }
This checks if the source and target version has an entry for each OS type in the cluster.
ambari-server/src/main/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheck.java