Search in sources :

Example 1 with StackGresDbOpsMinorVersionUpgradeStatus

use of io.stackgres.common.crd.sgdbops.StackGresDbOpsMinorVersionUpgradeStatus in project stackgres by ongres.

the class DbOpsTransformer method getResourceMinorVersionUpgradeStatus.

private DbOpsMinorVersionUpgradeStatus getResourceMinorVersionUpgradeStatus(StackGresDbOpsMinorVersionUpgradeStatus source) {
    if (source == null) {
        return null;
    }
    DbOpsMinorVersionUpgradeStatus transformation = new DbOpsMinorVersionUpgradeStatus();
    transformation.setPrimaryInstance(source.getPrimaryInstance());
    transformation.setInitialInstances(source.getInitialInstances());
    transformation.setPendingToRestartInstances(source.getPendingToRestartInstances());
    transformation.setRestartedInstances(source.getRestartedInstances());
    transformation.setSwitchoverInitiated(source.getSwitchoverInitiated());
    transformation.setSwitchoverFinalized(source.getSwitchoverFinalized());
    transformation.setFailure(source.getFailure());
    return transformation;
}
Also used : StackGresDbOpsMinorVersionUpgradeStatus(io.stackgres.common.crd.sgdbops.StackGresDbOpsMinorVersionUpgradeStatus) DbOpsMinorVersionUpgradeStatus(io.stackgres.apiweb.dto.dbops.DbOpsMinorVersionUpgradeStatus)

Example 2 with StackGresDbOpsMinorVersionUpgradeStatus

use of io.stackgres.common.crd.sgdbops.StackGresDbOpsMinorVersionUpgradeStatus in project stackgres by ongres.

the class MinorVersionUpgradeRestartStateHandlerImplTest method initializeDbOpsStatus.

@Override
protected void initializeDbOpsStatus(StackGresDbOps dbOps, List<Pod> pods) {
    final StackGresDbOpsMinorVersionUpgradeStatus minorVersionUpgradeStatus = new StackGresDbOpsMinorVersionUpgradeStatus();
    minorVersionUpgradeStatus.setInitialInstances(pods.stream().map(Pod::getMetadata).map(ObjectMeta::getName).collect(Collectors.toList()));
    minorVersionUpgradeStatus.setPrimaryInstance(getPrimaryInstance(pods).getMetadata().getName());
    minorVersionUpgradeStatus.setPendingToRestartInstances(pods.stream().map(Pod::getMetadata).map(ObjectMeta::getName).collect(Collectors.toList()));
    minorVersionUpgradeStatus.setSwitchoverInitiated(Boolean.FALSE.toString());
    dbOps.getStatus().setMinorVersionUpgrade(minorVersionUpgradeStatus);
}
Also used : ObjectMeta(io.fabric8.kubernetes.api.model.ObjectMeta) StackGresDbOpsMinorVersionUpgradeStatus(io.stackgres.common.crd.sgdbops.StackGresDbOpsMinorVersionUpgradeStatus)

Aggregations

StackGresDbOpsMinorVersionUpgradeStatus (io.stackgres.common.crd.sgdbops.StackGresDbOpsMinorVersionUpgradeStatus)2 ObjectMeta (io.fabric8.kubernetes.api.model.ObjectMeta)1 DbOpsMinorVersionUpgradeStatus (io.stackgres.apiweb.dto.dbops.DbOpsMinorVersionUpgradeStatus)1