class MaintenanceModeValidationService {

    public List<Warning> validateImageCatalog(Stack stack) {
        List<Warning> warnings = new ArrayList<>();
        try {
            Image image = componentConfigProviderService.getImage(stack.getId());
            StatedImage statedImage = imageCatalogService.getImage(image.getImageCatalogUrl(),
                    image.getImageCatalogName(), image.getImageId());

            if (!image.getPackageVersions().isEmpty()) {
                CheckResult checkResult = stackImageUpdateService.checkPackageVersions(stack, statedImage);
                if (checkResult.getStatus().equals(EventStatus.FAILED)) {
                    warnings.add(new Warning(WarningType.IMAGE_INCOMPATIBILITY_WARNING, checkResult.getMessage()));
                }
            }
        } catch (CloudbreakImageNotFoundException | CloudbreakImageCatalogException e) {
            throw new CloudbreakServiceException("Image info could not be validated!", e);
        }
        return warnings;
    }

}