Search in sources :

Example 1 with BlueprintUpgradeOption

use of com.sequenceiq.cloudbreak.domain.BlueprintUpgradeOption in project cloudbreak by hortonworks.

the class BlueprintUpgradeOptionValidator method isEnabledForDefaultBlueprint.

private BlueprintValidationResult isEnabledForDefaultBlueprint(boolean lockComponents, Blueprint blueprint, boolean skipValidations, boolean dataHubUpgradeEntitled) {
    BlueprintUpgradeOption upgradeOption = getBlueprintUpgradeOption(blueprint);
    BlueprintValidationResult result;
    if (skipValidations) {
        LOGGER.debug("Blueprint options are not validated if the request is internal");
        result = createResult(true);
    } else if (upgradeOption == BlueprintUpgradeOption.GA) {
        LOGGER.debug("Blueprint marks this GA so upgrade is enabled.");
        result = createResult(true);
    } else {
        result = createResult(lockComponents ? upgradeOption.isOsUpgradeEnabled() : isRuntimeUpgradeEnabled(upgradeOption, dataHubUpgradeEntitled));
    }
    return result;
}
Also used : BlueprintUpgradeOption(com.sequenceiq.cloudbreak.domain.BlueprintUpgradeOption)

Example 2 with BlueprintUpgradeOption

use of com.sequenceiq.cloudbreak.domain.BlueprintUpgradeOption in project cloudbreak by hortonworks.

the class DistroXUpgradeAvailabilityService method filterCandidates.

private List<ImageInfoV4Response> filterCandidates(String accountId, Stack stack, UpgradeV4Request request, UpgradeV4Response upgradeV4Response) {
    BlueprintUpgradeOption upgradeOption = stack.getCluster().getBlueprint().getBlueprintUpgradeOption();
    if (upgradeOption != BlueprintUpgradeOption.GA) {
        LOGGER.debug("Running filtering logic as upgrade option is {}, not GA", upgradeOption);
        filterOnlyPatchUpgradesIfRuntimeUpgradeDisabled(accountId, stack.getName(), upgradeV4Response);
    }
    List<ImageInfoV4Response> filteredCandidates;
    String stackName = stack.getName();
    boolean differentDataHubAndDataLakeVersionAllowed = entitlementService.isDifferentDataHubAndDataLakeVersionAllowed(accountId);
    if (differentDataHubAndDataLakeVersionAllowed) {
        LOGGER.info("Different Data Hub version is enabled, not filtering based on Data Lake version, Data Hub: {}", stackName);
        filteredCandidates = upgradeV4Response.getUpgradeCandidates();
    } else {
        LOGGER.info("Filter Data Hub upgrade images based on the Data Lake version, Data Hub: {}", stackName);
        filteredCandidates = filterForDatalakeVersion(stack, upgradeV4Response);
    }
    if (CollectionUtils.isNotEmpty(filteredCandidates) && Objects.nonNull(request)) {
        if (LATEST_ONLY == request.getShowAvailableImages()) {
            filteredCandidates = filterForLatestImagePerRuntime(filteredCandidates);
        } else if (request.isDryRun()) {
            filteredCandidates = filterForLatestImage(filteredCandidates);
        }
    }
    return filteredCandidates;
}
Also used : BlueprintUpgradeOption(com.sequenceiq.cloudbreak.domain.BlueprintUpgradeOption) ImageInfoV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response)

Aggregations

BlueprintUpgradeOption (com.sequenceiq.cloudbreak.domain.BlueprintUpgradeOption)2 ImageInfoV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image.ImageInfoV4Response)1