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;
}
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);
}
Aggregations