use of io.stackgres.common.crd.sgpooling.StackGresPoolingConfigPgBouncerStatus in project stackgres by ongres.
the class PgBouncerDefaultStateMutator method mutate.
@Override
public List<JsonPatchOperation> mutate(PoolingReview review) {
List<JsonPatchOperation> operations = new ArrayList<>();
StackGresPoolingConfig pgBouncerConfig = review.getRequest().getObject();
if (pgBouncerConfig.getStatus() == null) {
pgBouncerConfig.setStatus(new StackGresPoolingConfigStatus());
operations.add(buildAddOperation(PG_BOUNCER_DEFAULT_PARAMETERS_POINTER.parent().parent(), MAPPER.createObjectNode()));
}
if (pgBouncerConfig.getStatus().getPgBouncer() == null) {
pgBouncerConfig.getStatus().setPgBouncer(new StackGresPoolingConfigPgBouncerStatus());
operations.add(buildAddOperation(PG_BOUNCER_DEFAULT_PARAMETERS_POINTER.parent(), MAPPER.createObjectNode()));
}
operations.addAll(mutate(PG_BOUNCER_DEFAULT_PARAMETERS_POINTER, pgBouncerConfig));
return operations;
}
use of io.stackgres.common.crd.sgpooling.StackGresPoolingConfigPgBouncerStatus in project stackgres by ongres.
the class ClusterRequiredResourcesGeneratorTest method setUp.
@BeforeEach
void setUp() {
cluster = JsonUtil.readFromJson("stackgres_cluster/default.json", StackGresCluster.class);
cluster.getSpec().getPostgres().setVersion(StackGresComponent.POSTGRESQL.findLatestVersion());
final String namespace = cluster.getMetadata().getNamespace();
backupConfig = JsonUtil.readFromJson("backup_config/default.json", StackGresBackupConfig.class);
setNamespace(backupConfig);
postgresConfig = JsonUtil.readFromJson("postgres_config/default_postgres.json", StackGresPostgresConfig.class);
postgresConfig.getSpec().setPostgresVersion(StackGresComponent.POSTGRESQL.findLatestMajorVersion());
setNamespace(postgresConfig);
postgresConfig.setStatus(new StackGresPostgresConfigStatus());
postgresConfig.getStatus().setDefaultParameters(PostgresDefaultValues.getDefaultValues());
poolingConfig = JsonUtil.readFromJson("pooling_config/default.json", StackGresPoolingConfig.class);
setNamespace(poolingConfig);
poolingConfig.setStatus(new StackGresPoolingConfigStatus());
poolingConfig.getStatus().setPgBouncer(new StackGresPoolingConfigPgBouncerStatus());
poolingConfig.getStatus().getPgBouncer().setDefaultParameters(PgBouncerDefaultValues.getDefaultValues());
instanceProfile = JsonUtil.readFromJson("stackgres_profiles/size-s.json", StackGresProfile.class);
instanceProfile.getMetadata().setNamespace(namespace);
setNamespace(instanceProfile);
backups = JsonUtil.readFromJson("backup/list.json", StackGresBackupList.class).getItems();
backups.forEach(this::setNamespace);
minioSecret = JsonUtil.readFromJson("secret/minio.json", Secret.class);
}
Aggregations