use of io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices in project stackgres by ongres.
the class DefaultPostgresServicesMutatorTest method setupDistributedLogsPgServices.
private void setupDistributedLogsPgServices(StackGresPostgresService primary, StackGresPostgresService replicas) {
this.sgDistributedLogs = new StackGresDistributedLogsPostgresServices(primary, replicas);
review.getRequest().getObject().getSpec().setPostgresServices(sgDistributedLogs);
}
use of io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices in project stackgres by ongres.
the class DefaultPostgresServicesMutatorTest method clusterWithNoPostgresService_shouldBeSetup.
@Test
void clusterWithNoPostgresService_shouldBeSetup() {
review.getRequest().getObject().getSpec().setPostgresServices(null);
StackGresDistributedLogsPostgresServices pgServicesMuted = mutate(review);
assertNull(pgServicesMuted.getPrimary().getEnabled());
assertEquals(CLUSTER_IP.toString(), pgServicesMuted.getPrimary().getType());
assertEquals(Boolean.TRUE, pgServicesMuted.getReplicas().getEnabled());
assertEquals(CLUSTER_IP.toString(), pgServicesMuted.getReplicas().getType());
}
use of io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices in project stackgres by ongres.
the class DefaultPostgresServicesMutatorTest method clusterWithPgServiceReplicaNoEnabled_shouldBeSetup.
@Test
void clusterWithPgServiceReplicaNoEnabled_shouldBeSetup() {
setupDistributedLogsPgServices(withPgPrimaryService(TRUE, LOAD_BALANCER.toString()), withPgReplicasService(null, LOAD_BALANCER.toString()));
StackGresDistributedLogsPostgresServices pgServicesMuted = mutate(review);
assertNull(pgServicesMuted.getPrimary().getEnabled());
assertEquals(LOAD_BALANCER.toString(), pgServicesMuted.getPrimary().getType());
assertEquals(Boolean.TRUE, pgServicesMuted.getReplicas().getEnabled());
assertEquals(LOAD_BALANCER.toString(), pgServicesMuted.getReplicas().getType());
}
use of io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices in project stackgres by ongres.
the class DefaultPostgresServicesMutatorTest method clusterWithNoPgServiceReplicas_shouldSetValue.
@Test
void clusterWithNoPgServiceReplicas_shouldSetValue() {
setupDistributedLogsPgServices(withPgPrimaryService(FALSE, LOAD_BALANCER.toString()), withNoPgReplicasService());
StackGresDistributedLogsPostgresServices pgServicesMuted = mutate(review);
assertNull(pgServicesMuted.getPrimary().getEnabled());
assertEquals(LOAD_BALANCER.toString(), pgServicesMuted.getPrimary().getType());
assertEquals(Boolean.TRUE, pgServicesMuted.getReplicas().getEnabled());
assertEquals(CLUSTER_IP.toString(), pgServicesMuted.getReplicas().getType());
}
use of io.stackgres.common.crd.sgdistributedlogs.StackGresDistributedLogsPostgresServices in project stackgres by ongres.
the class DefaultPostgresServicesMutatorTest method clusterWithPostgresServiceNoEnabled_shouldSetValue.
@Test
void clusterWithPostgresServiceNoEnabled_shouldSetValue() {
setupDistributedLogsPgServices(withPgPrimaryService(null, LOAD_BALANCER.toString()), withNoPgReplicasService());
StackGresDistributedLogsPostgresServices pgServicesMuted = mutate(review);
assertNull(pgServicesMuted.getPrimary().getEnabled());
assertEquals(LOAD_BALANCER.toString(), pgServicesMuted.getPrimary().getType());
assertEquals(Boolean.TRUE, pgServicesMuted.getReplicas().getEnabled());
assertEquals(CLUSTER_IP.toString(), pgServicesMuted.getReplicas().getType());
}
Aggregations