Search in sources :

Example 6 with ReconciliationResult

use of io.stackgres.operator.conciliation.ReconciliationResult in project stackgres by ongres.

the class BackupConciliator method evalReconciliationState.

@Override
public ReconciliationResult evalReconciliationState(StackGresBackup config) {
    final ReconciliationResult reconciliationResult = super.evalReconciliationState(config);
    reconciliationResult.setDeletions(reconciliationResult.getDeletions().stream().filter(ReconciliationUtil::isResourceReconciliationNotPausedUntilRestart).collect(Collectors.toUnmodifiableList()));
    reconciliationResult.setPatches(reconciliationResult.getPatches().stream().filter(tuple -> ReconciliationUtil.isResourceReconciliationNotPausedUntilRestart(tuple.v2)).collect(Collectors.toUnmodifiableList()));
    return reconciliationResult;
}
Also used : ReconciliationResult(io.stackgres.operator.conciliation.ReconciliationResult) ReconciliationUtil(io.stackgres.operator.conciliation.ReconciliationUtil)

Example 7 with ReconciliationResult

use of io.stackgres.operator.conciliation.ReconciliationResult in project stackgres by ongres.

the class DistributedLogsConciliator method evalReconciliationState.

@Override
public ReconciliationResult evalReconciliationState(StackGresDistributedLogs config) {
    final ReconciliationResult reconciliationResult = super.evalReconciliationState(config);
    if (distributedLogsStatusManager.isPendingRestart(config)) {
        reconciliationResult.setDeletions(reconciliationResult.getDeletions().stream().filter(ReconciliationUtil::isResourceReconciliationNotPausedUntilRestart).collect(Collectors.toUnmodifiableList()));
        reconciliationResult.setPatches(reconciliationResult.getPatches().stream().filter(tuple -> ReconciliationUtil.isResourceReconciliationNotPausedUntilRestart(tuple.v2)).collect(Collectors.toUnmodifiableList()));
    }
    return reconciliationResult;
}
Also used : ReconciliationResult(io.stackgres.operator.conciliation.ReconciliationResult) ReconciliationUtil(io.stackgres.operator.conciliation.ReconciliationUtil)

Example 8 with ReconciliationResult

use of io.stackgres.operator.conciliation.ReconciliationResult in project stackgres by ongres.

the class ClusterConciliator method evalReconciliationState.

@Override
public ReconciliationResult evalReconciliationState(StackGresCluster config) {
    final ReconciliationResult reconciliationResult = super.evalReconciliationState(config);
    if (statusManager.isPendingRestart(config)) {
        reconciliationResult.setDeletions(reconciliationResult.getDeletions().stream().filter(ReconciliationUtil::isResourceReconciliationNotPausedUntilRestart).collect(Collectors.toUnmodifiableList()));
        reconciliationResult.setPatches(reconciliationResult.getPatches().stream().filter(tuple -> ReconciliationUtil.isResourceReconciliationNotPausedUntilRestart(tuple.v2)).collect(Collectors.toUnmodifiableList()));
    }
    return reconciliationResult;
}
Also used : ReconciliationResult(io.stackgres.operator.conciliation.ReconciliationResult) ReconciliationUtil(io.stackgres.operator.conciliation.ReconciliationUtil)

Aggregations

ReconciliationResult (io.stackgres.operator.conciliation.ReconciliationResult)8 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)4 StackGresDistributedLogs (io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogs)4 ConciliatorTest (io.stackgres.operator.conciliation.ConciliatorTest)4 ReconciliationUtil (io.stackgres.operator.conciliation.ReconciliationUtil)4 DisplayName (org.junit.jupiter.api.DisplayName)4 Test (org.junit.jupiter.api.Test)4 ArrayList (java.util.ArrayList)2 Random (java.util.Random)2