use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.
the class ImageService method addCmRepo.
private void addCmRepo(Stack stack, Set<Component> components, com.sequenceiq.cloudbreak.cloud.model.catalog.Image catalogBasedImage) throws CloudbreakImageCatalogException {
if (catalogBasedImage.getStackDetails() != null) {
ImageStackDetails stackDetails = catalogBasedImage.getStackDetails();
StackType stackType = determineStackType(stackDetails);
ClouderaManagerRepo clouderaManagerRepo = getClouderaManagerRepo(catalogBasedImage, stackType);
components.add(new Component(CM_REPO_DETAILS, CM_REPO_DETAILS.name(), new Json(clouderaManagerRepo), stack));
} else {
LOGGER.debug("There are no stackDetails for stack {}, cannot determine CM repo version.", stack.getName());
}
}
use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.
the class CustomImageProvider method getStackDetailsWithCustomBaseUrl.
private ImageStackDetails getStackDetailsWithCustomBaseUrl(ImageStackDetails details, String customBaseUrl) {
if (details != null) {
Map<String, String> stack = details.getRepo().getStack().entrySet().stream().collect(toMap(Map.Entry::getKey, e -> changeBaseUrlToCustomUrl(e.getValue(), customBaseUrl)));
StackRepoDetails repoDetails = new StackRepoDetails(stack, details.getRepo().getUtil());
return new ImageStackDetails(details.getVersion(), repoDetails, details.getStackBuildNumber());
}
return null;
}
use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.
the class ImageBasedDefaultCDHEntriesTest method getImages.
private List<Image> getImages() {
StackRepoDetails stackRepoDetails = new StackRepoDetails(getRepo(), null);
ImageStackDetails stackDetails = new ImageStackDetails(null, stackRepoDetails, null);
List<List<String>> parcels = getParcels();
Image defaultImage = mock(Image.class);
when(defaultImage.isDefaultImage()).thenReturn(true);
when(defaultImage.getVersion()).thenReturn(IMAGE_VERSION);
when(defaultImage.getStackDetails()).thenReturn(stackDetails);
when(defaultImage.getPreWarmParcels()).thenReturn(parcels);
when(defaultImage.getPreWarmCsd()).thenReturn(PRE_WARM_CSD);
Image nonDefaultImage = mock(Image.class);
when(nonDefaultImage.isDefaultImage()).thenReturn(false);
// the algorithm is not failing on multiple default images for the same version
return asList(defaultImage, defaultImage, nonDefaultImage);
}
use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.
the class ImageCreationBasedUpgradeImageFilterTest method mockSameVersion.
private void mockSameVersion(Image current, Image candidate) {
ImageStackDetails currentStackDetails = mock(ImageStackDetails.class);
ImageStackDetails candidateStackDetails = mock(ImageStackDetails.class);
when(current.getStackDetails()).thenReturn(currentStackDetails);
when(candidate.getStackDetails()).thenReturn(candidateStackDetails);
when(currentStackDetails.getVersion()).thenReturn("a");
when(candidateStackDetails.getVersion()).thenReturn("a");
}
use of com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails in project cloudbreak by hortonworks.
the class StackVersionMatcherTest method testMissingStackRepoDetails.
@Test
public void testMissingStackRepoDetails() {
when(image.getStackDetails()).thenReturn(new ImageStackDetails("ver", null, "build"));
boolean result = underTest.isMatchingStackVersion(image, ACTIVATED_PARCELS);
assertTrue(result);
}
Aggregations