Search in sources :

Example 11 with UpgradeCcmEvent

use of com.sequenceiq.freeipa.flow.stack.upgrade.ccm.event.UpgradeCcmEvent in project cloudbreak by hortonworks.

the class UpgradeCcmUpgradeHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<UpgradeCcmEvent> event) {
    UpgradeCcmEvent request = event.getData();
    if (request.getOldTunnel().useCcmV1()) {
        try {
            LOGGER.info("Running upgrade state for CCM...");
            upgradeCcmService.upgrade(request.getResourceId());
        } catch (CloudbreakOrchestratorException e) {
            LOGGER.debug("Failed applying CCM upgrade state");
            return new UpgradeCcmFailureEvent(UPGRADE_CCM_FAILED_EVENT.event(), request.getResourceId(), e);
        }
    } else {
        LOGGER.info("Running upgrade step is skipped for previous tunnel type '{}'", request.getOldTunnel());
    }
    return UPGRADE_CCM_UPGRADE_FINISHED_EVENT.createBasedOn(request);
}
Also used : UpgradeCcmEvent(com.sequenceiq.freeipa.flow.stack.upgrade.ccm.event.UpgradeCcmEvent) CloudbreakOrchestratorException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException) UpgradeCcmFailureEvent(com.sequenceiq.freeipa.flow.stack.upgrade.ccm.event.UpgradeCcmFailureEvent)

Aggregations

UpgradeCcmEvent (com.sequenceiq.freeipa.flow.stack.upgrade.ccm.event.UpgradeCcmEvent)11 BeforeEach (org.junit.jupiter.api.BeforeEach)2 CloudbreakOrchestratorException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException)1 StackEvent (com.sequenceiq.freeipa.flow.stack.StackEvent)1 UpgradeCcmService (com.sequenceiq.freeipa.flow.stack.upgrade.ccm.UpgradeCcmService)1 UpgradeCcmFailureEvent (com.sequenceiq.freeipa.flow.stack.upgrade.ccm.event.UpgradeCcmFailureEvent)1 Map (java.util.Map)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 ArgumentsSource (org.junit.jupiter.params.provider.ArgumentsSource)1 Bean (org.springframework.context.annotation.Bean)1 Event (reactor.bus.Event)1