@Test public void getTagsViaImageName() throws Exception { RegistryService privHub = registryRepository.getRegistryByImageName(PRIVATE_REGISTRY + "/cluster-manager"); Tags ni1Tags = privHub.getTags("cluster-manager"); Assert.assertNotNull(ni1Tags); Assert.assertTrue(ni1Tags.getTags().size() > 0); RegistryService awshub = registryRepository.getRegistryByImageName(AWS_REGISTRY+ "/cluster-manager"); Tags tagsAmazone = awshub.getTags("cluster-manager"); Assert.assertNotNull(tagsAmazone); Assert.assertTrue(tagsAmazone.getTags().size() > 0); RegistryService pdhub = registryRepository.getRegistryByImageName("codeabovelab"+ "/cluster-manager"); Tags tags = pdhub.getTags("cluster-manager"); Assert.assertNotNull(tags); Assert.assertTrue(tags.getTags().size() > 0); RegistryService dhub = registryRepository.getRegistryByImageName("tutum/ubuntu"); Tags tagsTutum = dhub.getTags("ubuntu"); Assert.assertNotNull(tagsTutum); Assert.assertTrue(tagsTutum.getTags().size() > 0); dhub = registryRepository.getRegistryByImageName("ubuntu"); Tags tagsUbuntu = dhub.getTags("ubuntu"); Assert.assertNotNull(tagsUbuntu); Assert.assertTrue(tagsUbuntu.getTags().size() > 0); }
public RegistryService getRegistryByImageName(String imageName) { RegistryService registryService; if (!StringUtils.hasText(imageName)) { return wrapDefault(imageName); } String registryPrefix = ContainerUtils.getRegistryPrefix(imageName); RegistryService byName = getByName(registryPrefix); if (byName != null) { registryService = byName; } else if (!ImageName.isRegistry(registryPrefix)) { registryService = wrapDefault(registryPrefix); } else { return null; } if (registryService.getConfig().isDisabled() || StringUtils.hasText(registryService.getConfig().getErrorMessage())) { return new DisabledRegistryServiceWrapper(registryService); } return registryService; }
RegistryRepository implements SupportSearch { public RegistryService getRegistryByImageName(String imageName) { RegistryService registryService; if (!StringUtils.hasText(imageName)) { return wrapDefault(imageName); } String registryPrefix = ContainerUtils.getRegistryPrefix(imageName); RegistryService byName = getByName(registryPrefix); if (byName != null) { registryService = byName; } else if (!ImageName.isRegistry(registryPrefix)) { registryService = wrapDefault(registryPrefix); } else { return null; } if (registryService.getConfig().isDisabled() || StringUtils.hasText(registryService.getConfig().getErrorMessage())) { return new DisabledRegistryServiceWrapper(registryService); } return registryService; } }
RegistryRepository implements SupportSearch { public RegistryService getRegistryByImageName(String imageName) { RegistryService registryService; if (!StringUtils.hasText(imageName)) { return wrapDefault(imageName); } String registryPrefix = ContainerUtils.getRegistryPrefix(imageName); RegistryService byName = getByName(registryPrefix); if (byName != null) { registryService = byName; } else if (!ImageName.isRegistry(registryPrefix)) { registryService = wrapDefault(registryPrefix); } else { return null; } if (registryService.getConfig().isDisabled() || StringUtils.hasText(registryService.getConfig().getErrorMessage())) { return new DisabledRegistryServiceWrapper(registryService); } return registryService; } RegistryRepository(KvMapperFactory mapperFactory,
                              DockerHubRegistry defaultRegistry,
                              RegistryFactory factory,
                              @Qualifier(RegistryEvent.BUS) MessageBus<RegistryEvent> eventBus); }
RegistryRepository implements SupportSearch { public RegistryService getRegistryByImageName(String imageName) { RegistryService registryService; if (!StringUtils.hasText(imageName)) { return wrapDefault(imageName); } String registryPrefix = ContainerUtils.getRegistryPrefix(imageName); RegistryService byName = getByName(registryPrefix); if (byName != null) { registryService = byName; } else if (!ImageName.isRegistry(registryPrefix)) { registryService = wrapDefault(registryPrefix); } else { return null; } if (registryService.getConfig().isDisabled() || StringUtils.hasText(registryService.getConfig().getErrorMessage())) { return new DisabledRegistryServiceWrapper(registryService); } return registryService; } RegistryRepository(KvMapperFactory mapperFactory,
                              DockerHubRegistry defaultRegistry,
                              RegistryFactory factory,
                              @Qualifier(RegistryEvent.BUS) MessageBus<RegistryEvent> eventBus); void init(List<RegistryConfig> configs); void register(RegistryService registryService); void unRegister(String name); List<ImageCatalog> getCatalog(Collection<String> names); Collection<String> getAvailableRegistries(); String resolveRegistryNameByImageName(String imageName); RegistryService getRegistryByImageName(String imageName); RegistryService getByName(String registryName); @Override SearchResult search(String query, final int page, final int size); }
RegistryRepository implements SupportSearch { public RegistryService getRegistryByImageName(String imageName) { RegistryService registryService; if (!StringUtils.hasText(imageName)) { return wrapDefault(imageName); } String registryPrefix = ContainerUtils.getRegistryPrefix(imageName); RegistryService byName = getByName(registryPrefix); if (byName != null) { registryService = byName; } else if (!ImageName.isRegistry(registryPrefix)) { registryService = wrapDefault(registryPrefix); } else { return null; } if (registryService.getConfig().isDisabled() || StringUtils.hasText(registryService.getConfig().getErrorMessage())) { return new DisabledRegistryServiceWrapper(registryService); } return registryService; } RegistryRepository(KvMapperFactory mapperFactory,
                              DockerHubRegistry defaultRegistry,
                              RegistryFactory factory,
                              @Qualifier(RegistryEvent.BUS) MessageBus<RegistryEvent> eventBus); void init(List<RegistryConfig> configs); void register(RegistryService registryService); void unRegister(String name); List<ImageCatalog> getCatalog(Collection<String> names); Collection<String> getAvailableRegistries(); String resolveRegistryNameByImageName(String imageName); RegistryService getRegistryByImageName(String imageName); RegistryService getByName(String registryName); @Override SearchResult search(String query, final int page, final int size);  }