use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverter method decorateBuilderWithProductDetails.
private void decorateBuilderWithProductDetails(StackV4Request source, TemplatePreparationObject.Builder builder) {
// base image
if (source.getCluster() != null && source.getCluster().getCm() != null && source.getCluster().getCm().getRepository() != null) {
ClouderaManagerV4Request cm = source.getCluster().getCm();
ClouderaManagerRepositoryV4Request repository = cm.getRepository();
ClouderaManagerRepo cmRepo = new ClouderaManagerRepo().withBaseUrl(repository.getBaseUrl()).withGpgKeyUrl(repository.getGpgKeyUrl()).withVersion(repository.getVersion());
List<ClouderaManagerProduct> products = null != cm.getProducts() ? cm.getProducts().stream().map(StackV4RequestToTemplatePreparationObjectConverter::convertProduct).collect(toList()) : new ArrayList<>();
builder.withProductDetails(cmRepo, products);
// prewarm image
}
// TODO: implement else {} branch for prewarm images
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class StackRuntimeVersionValidatorTest method getCdhProduct.
private ClouderaManagerProduct getCdhProduct(String version) {
ClouderaManagerProduct product = new ClouderaManagerProduct();
product.setName("CDH");
product.setVersion(version + "-something");
return product;
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class ImageFilterParamsFactoryTest method testCreateShouldReturnsANewImageFilterParamsInstanceWhenTheStackTypeIsDataHub.
@Test
public void testCreateShouldReturnsANewImageFilterParamsInstanceWhenTheStackTypeIsDataHub() {
Image image = mock(Image.class);
Stack stack = createStack(StackType.WORKLOAD);
Set<ClusterComponent> cdhClusterComponent = createCdhClusterComponent();
String sparkName = "Spark";
String sparkVersion = "123";
ClouderaManagerProduct spark = createCMProduct(sparkName, sparkVersion);
String nifiName = "Nifi";
String nifiVersion = "456";
ClouderaManagerProduct nifi = createCMProduct(nifiName, nifiVersion);
when(platformStringTransformer.getPlatformStringForImageCatalog(anyString(), anyString())).thenReturn(imageCatalogPlatform(CLOUD_PLATFORM));
when(parcelService.getParcelComponentsByBlueprint(stack)).thenReturn(cdhClusterComponent);
when(clouderaManagerProductsProvider.getProducts(cdhClusterComponent)).thenReturn(Set.of(spark, nifi));
ImageFilterParams actual = underTest.create(image, true, stack, new InternalUpgradeSettings(true, true, true));
assertEquals(image, actual.getCurrentImage());
assertTrue(actual.isLockComponents());
assertTrue(actual.isSkipValidations());
assertEquals(sparkVersion, actual.getStackRelatedParcels().get(sparkName));
assertEquals(nifiVersion, actual.getStackRelatedParcels().get(nifiName));
assertEquals(StackType.WORKLOAD, actual.getStackType());
assertEquals(blueprint, actual.getBlueprint());
assertEquals(STACK_ID, actual.getStackId());
assertEquals(CLOUD_PLATFORM, actual.getCloudPlatform().nameToUpperCase());
verify(parcelService).getParcelComponentsByBlueprint(stack);
verify(clouderaManagerProductsProvider).getProducts(cdhClusterComponent);
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class RuntimeVersionServiceTest method getCdhProduct.
private ClouderaManagerProduct getCdhProduct(String version) {
ClouderaManagerProduct product = new ClouderaManagerProduct();
product.setName("CDH");
product.setVersion(version + "-something");
return product;
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.
the class RuntimeVersionServiceTest method testGetCdhVersionFromClouderaManagerProductsIfNameAddedButVersionMissing.
@Test
public void testGetCdhVersionFromClouderaManagerProductsIfNameAddedButVersionMissing() {
ClouderaManagerProduct cdhProduct = getCdhProduct();
Optional<String> actual = RuntimeVersionService.getRuntimeVersionFromClouderaManagerProducts(List.of(cdhProduct));
Assertions.assertTrue(actual.isEmpty());
}
Aggregations