@Experimental(feature = ExperimentalFeature.CUSTOM_SERVICE_REPOS,
    comment = "Remove logic for handling custom service repos after enabling multi-mpack cluster deployment")
  public static boolean addServiceReposToOperatingSystemEntities(List<RepoOsEntity> operatingSystems,
                                                                 ListMultimap<String, RepositoryInfo> stackReposByOs) {
    Set<String> addedRepos = new HashSet<>();
    for (RepoOsEntity os : operatingSystems) {
      List<RepositoryInfo> serviceReposForOs = stackReposByOs.get(os.getFamily());
      ImmutableSet<String> repoNames = ImmutableSet.copyOf(Lists.transform(os.getRepoDefinitionEntities(), REPO_ENTITY_TO_NAME));
      for (RepositoryInfo repoInfo : serviceReposForOs)
        if (!repoNames.contains(repoInfo.getRepoName())) {
          os.addRepoDefinition(toRepositoryEntity(repoInfo));
          addedRepos.add(String.format("%s (%s)", repoInfo.getRepoId(), os.getFamily()));
        }
    }
    LOG.info("Added {} service repos: {}", addedRepos.size(),Iterables.toString(addedRepos));

    return CollectionUtils.isNotEmpty(addedRepos);
  }
Checks the passed {@code operatingSystems} parameter if it contains all repositories from the stack model. If a
   repository is present in the stack model but missing in the operating system entity list, it is considered a
   service repository and will be added.
@param operatingSystems - A list of OperatingSystemEntity objects extracted from a RepositoryVersionEntity
@param stackReposByOs - Stack repositories loaded from the disk (including service repositories), grouped by os.
@return {@code true} if there were added repositories
ambari-server/src/main/java/org/apache/ambari/server/stack/RepoUtil.java