use of com.netflix.spinnaker.kork.plugins.update.downloader.FileDownloaderProvider in project kork by spinnaker.
the class PluginsAutoConfiguration method pluginUpdateRepositories.
@Bean
@SneakyThrows
public static List<UpdateRepository> pluginUpdateRepositories(Map<String, PluginRepositoryProperties> pluginRepositoriesConfig, FileDownloaderProvider fileDownloaderProvider, PluginsConfigurationProperties properties) {
List<UpdateRepository> repositories = pluginRepositoriesConfig.entrySet().stream().filter(entry -> entry.getValue().isEnabled()).filter(entry -> !entry.getKey().equals(PluginsConfigurationProperties.FRONT5O_REPOSITORY)).map(entry -> new ConfigurableUpdateRepository(entry.getKey(), entry.getValue().getUrl(), fileDownloaderProvider.get(entry.getValue().fileDownloader), new CompoundVerifier())).collect(Collectors.toList());
if (properties.isEnableDefaultRepositories()) {
log.info("Enabling spinnaker-official and spinnaker-community plugin repositories");
repositories.add(new ConfigurableUpdateRepository(PluginsConfigurationProperties.SPINNAKER_OFFICIAL_REPOSITORY, new URL("https://raw.githubusercontent.com/spinnaker/plugins/master/official/plugins.json"), fileDownloaderProvider.get(null), new CompoundVerifier()));
repositories.add(new ConfigurableUpdateRepository(PluginsConfigurationProperties.SPINNAKER_COMMUNITY_REPOSITORY, new URL("https://raw.githubusercontent.com/spinnaker/plugins/master/community/plugins.json"), fileDownloaderProvider.get(null), new CompoundVerifier()));
}
if (repositories.isEmpty()) {
log.warn("No remote repositories defined, will fallback to looking for a " + "'repositories.json' file next to the application executable");
}
return repositories;
}
Aggregations