use of io.stackgres.common.crd.sgcluster.StackGresClusterDbOpsMinorVersionUpgradeStatus in project stackgres by ongres.
the class MinorVersionUpgradeRestartStateHandlerImpl method initRestartStatusValues.
@Override
protected Uni<Void> initRestartStatusValues(ClusterRestartState clusterRestartState, StackGresCluster cluster) {
return super.initRestartStatusValues(clusterRestartState, cluster).chain(ignore -> Uni.combine().all().unis(getSourcePostgresVersion(cluster), getTargetPostgresVersion(cluster)).asTuple()).chain(versionTuple -> {
StackGresClusterDbOpsMinorVersionUpgradeStatus restartStatus = cluster.getStatus().getDbOps().getMinorVersionUpgrade();
restartStatus.setSourcePostgresVersion(versionTuple.getItem1());
restartStatus.setTargetPostgresVersion(versionTuple.getItem2());
return Uni.createFrom().voidItem();
});
}
use of io.stackgres.common.crd.sgcluster.StackGresClusterDbOpsMinorVersionUpgradeStatus in project stackgres by ongres.
the class MinorVersionUpgradeRestartStateHandlerImplTest method initializeClusterStatus.
@Override
protected void initializeClusterStatus(StackGresCluster cluster, List<Pod> pods) {
final StackGresClusterStatus status = new StackGresClusterStatus();
final StackGresClusterDbOpsStatus dbOps = new StackGresClusterDbOpsStatus();
final StackGresClusterDbOpsMinorVersionUpgradeStatus minorVersionUpgrade = new StackGresClusterDbOpsMinorVersionUpgradeStatus();
minorVersionUpgrade.setInitialInstances(pods.stream().map(Pod::getMetadata).map(ObjectMeta::getName).collect(Collectors.toList()));
minorVersionUpgrade.setPrimaryInstance(getPrimaryInstance(pods).getMetadata().getName());
minorVersionUpgrade.setSourcePostgresVersion("11.6");
minorVersionUpgrade.setTargetPostgresVersion(cluster.getSpec().getPostgres().getVersion());
dbOps.setMinorVersionUpgrade(minorVersionUpgrade);
status.setDbOps(dbOps);
cluster.setStatus(status);
}
Aggregations