Search in sources :

Example 11 with StackGresPostgresService

use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.

the class DistributedLogsPostgresServicesConverterTest method shouldPgServicePrimaryBeConvertedSuccessfully_fromSgDistributedLogsPgServicePrimary.

@Test
void shouldPgServicePrimaryBeConvertedSuccessfully_fromSgDistributedLogsPgServicePrimary() {
    StackGresDistributedLogsPostgresServices sgPostgresServices = new StackGresDistributedLogsPostgresServicesFixture().withPrimary().build();
    DistributedLogsPostgresServices pgServicesConverted = converter.from(sgPostgresServices);
    StackGresPostgresService sgPgPrimary = sgPostgresServices.getPrimary();
    PostgresService dlPgPrimary = pgServicesConverted.getPrimary();
    assertEquals(sgPgPrimary.getEnabled(), dlPgPrimary.getEnabled());
    assertEquals(sgPgPrimary.getType(), dlPgPrimary.getType());
    assertNull(pgServicesConverted.getReplicas());
}
Also used : StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) DistributedLogsPostgresServices(io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices) StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) StackGresDistributedLogsPostgresServicesFixture(io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) PostgresService(io.stackgres.apiweb.app.postgres.service.PostgresService) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) Test(org.junit.jupiter.api.Test)

Example 12 with StackGresPostgresService

use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.

the class DistributedLogsPostgresServicesConverterTest method shouldPgServiceReplicasBeConvertedSuccessfully_fromSgDistributedLogsPgServiceReplicas.

@Test
void shouldPgServiceReplicasBeConvertedSuccessfully_fromSgDistributedLogsPgServiceReplicas() {
    StackGresDistributedLogsPostgresServices sgPostgresServices = new StackGresDistributedLogsPostgresServicesFixture().withReplicas().build();
    DistributedLogsPostgresServices pgServicesConverted = converter.from(sgPostgresServices);
    StackGresPostgresService sgPgReplicas = sgPostgresServices.getReplicas();
    PostgresService dlPgReplicas = pgServicesConverted.getReplicas();
    assertEquals(sgPgReplicas.getEnabled(), dlPgReplicas.getEnabled());
    assertEquals(sgPgReplicas.getType(), dlPgReplicas.getType());
    assertNull(pgServicesConverted.getPrimary());
}
Also used : StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) DistributedLogsPostgresServices(io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices) StackGresDistributedLogsPostgresServices(io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices) StackGresDistributedLogsPostgresServicesFixture(io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) PostgresService(io.stackgres.apiweb.app.postgres.service.PostgresService) StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService) Test(org.junit.jupiter.api.Test)

Example 13 with StackGresPostgresService

use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.

the class StackGresDistributedLogsPostgresServicesFixture method withPrimary.

public StackGresDistributedLogsPostgresServicesFixture withPrimary() {
    StackGresPostgresService primary = new StackGresPostgresService();
    primary.setEnabled(true);
    primary.setType(StackGresPostgresServiceType.CLUSTER_IP.name());
    postgresServices.setPrimary(primary);
    return this;
}
Also used : StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService)

Example 14 with StackGresPostgresService

use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.

the class StackGresDistributedLogsPostgresServicesFixture method withReplicas.

public StackGresDistributedLogsPostgresServicesFixture withReplicas() {
    StackGresPostgresService replicas = new StackGresPostgresService();
    replicas.setEnabled(true);
    replicas.setType(StackGresPostgresServiceType.CLUSTER_IP.name());
    this.postgresServices.setReplicas(replicas);
    return this;
}
Also used : StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService)

Example 15 with StackGresPostgresService

use of io.stackgres.common.crd.postgres.service.StackGresPostgresService in project stackgres by ongres.

the class PatroniServicesTest method enablePrimaryService.

private void enablePrimaryService(StackGresPostgresServiceType type) {
    enablePrimaryService(true);
    final StackGresPostgresService primary = defaultCluster.getSpec().getPostgresServices().getPrimary();
    primary.setType(type.toString());
}
Also used : StackGresPostgresService(io.stackgres.common.crd.postgres.service.StackGresPostgresService)

Aggregations

StackGresPostgresService (io.stackgres.common.crd.postgres.service.StackGresPostgresService)19 StackGresClusterPostgresServices (io.stackgres.common.crd.sgcluster.StackGresClusterPostgresServices)10 Test (org.junit.jupiter.api.Test)7 StackGresCluster (io.stackgres.common.crd.sgcluster.StackGresCluster)6 PostgresService (io.stackgres.apiweb.app.postgres.service.PostgresService)4 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)2 IntOrString (io.fabric8.kubernetes.api.model.IntOrString)2 Service (io.fabric8.kubernetes.api.model.Service)2 ClusterConfiguration (io.stackgres.apiweb.dto.cluster.ClusterConfiguration)2 ClusterInitData (io.stackgres.apiweb.dto.cluster.ClusterInitData)2 ClusterPostgresServices (io.stackgres.apiweb.dto.cluster.ClusterPostgresServices)2 ClusterSpecAnnotations (io.stackgres.apiweb.dto.cluster.ClusterSpecAnnotations)2 ClusterSpecLabels (io.stackgres.apiweb.dto.cluster.ClusterSpecLabels)2 ClusterSpecMetadata (io.stackgres.apiweb.dto.cluster.ClusterSpecMetadata)2 ClusterSsl (io.stackgres.apiweb.dto.cluster.ClusterSsl)2 DistributedLogsPostgresServices (io.stackgres.apiweb.dto.distributedlogs.DistributedLogsPostgresServices)2 ClusterPodSchedulingConverter (io.stackgres.apiweb.transformer.converter.cluster.ClusterPodSchedulingConverter)2 StackGresDistributedLogsPostgresServicesFixture (io.stackgres.apiweb.transformer.distributedlogs.converter.fixture.StackGresDistributedLogsPostgresServicesFixture)2 StackGresClusterConfiguration (io.stackgres.common.crd.sgcluster.StackGresClusterConfiguration)2 StackGresClusterInitData (io.stackgres.common.crd.sgcluster.StackGresClusterInitData)2