Skip to content

Commit 0d61233

Browse files
committed
configure profiles with related compose dev services to test against PostgreSQL 15 to 18
1 parent b4f4b1d commit 0d61233

15 files changed

Lines changed: 126 additions & 13 deletions

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,21 @@ run:
1414
generate-jooq:
1515
./gradlew --console=colored :generated:jooqCodegen
1616

17+
# Latest PostgreSQL Version configured in application.yml
1718
test:
18-
./gradlew --console=colored :operator:clean :operator:test
19+
./gradlew --console=colored :operator:clean :operator:test --rerun-tasks
20+
21+
test-pg18:
22+
./gradlew --console=colored :operator:clean :operator:test --rerun-tasks -Dquarkus.test.profile=test-pg18
23+
24+
test-pg17:
25+
./gradlew --console=colored :operator:clean :operator:test --rerun-tasks -Dquarkus.test.profile=test-pg17
26+
27+
test-pg16:
28+
./gradlew --console=colored :operator:clean :operator:test --rerun-tasks -Dquarkus.test.profile=test-pg16
29+
30+
test-pg15:
31+
./gradlew --console=colored :operator:clean :operator:test --rerun-tasks -Dquarkus.test.profile=test-pg15
1932

2033
# Flag targets as phony, to tell `make` that these are no file targets
21-
.PHONY: init install run generate-jooq test
34+
.PHONY: init install run generate-jooq test test-pg18 test-pg17 test-pg16 test-pg15
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
db:
3+
image: postgres:15
4+
command: "postgres -c checkpoint_timeout=10min -c fsync=off -c full_page_writes=off -c max_wal_size=2GB -c synchronous_commit=off"
5+
tmpfs:
6+
- /var/lib/postgresql/data
7+
healthcheck:
8+
test: pg_isready -U root -d dummy
9+
interval: 3s
10+
timeout: 3s
11+
retries: 3
12+
ports:
13+
- "5432"
14+
labels:
15+
io.quarkus.devservices.compose.config_map.port.5432: quarkus.datasource.jdbc.port
16+
environment:
17+
- POSTGRES_USER=root
18+
- POSTGRES_PASSWORD=password
19+
- POSTGRES_DB=dummy
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
db:
3+
image: postgres:16
4+
command: "postgres -c checkpoint_timeout=10min -c fsync=off -c full_page_writes=off -c max_wal_size=2GB -c synchronous_commit=off"
5+
tmpfs:
6+
- /var/lib/postgresql/data
7+
healthcheck:
8+
test: pg_isready -U root -d dummy
9+
interval: 3s
10+
timeout: 3s
11+
retries: 3
12+
ports:
13+
- "5432"
14+
labels:
15+
io.quarkus.devservices.compose.config_map.port.5432: quarkus.datasource.jdbc.port
16+
environment:
17+
- POSTGRES_USER=root
18+
- POSTGRES_PASSWORD=password
19+
- POSTGRES_DB=dummy
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
db:
3+
image: postgres:17
4+
command: "postgres -c checkpoint_timeout=10min -c fsync=off -c full_page_writes=off -c max_wal_size=2GB -c synchronous_commit=off"
5+
tmpfs:
6+
- /var/lib/postgresql/data
7+
healthcheck:
8+
test: pg_isready -U root -d dummy
9+
interval: 3s
10+
timeout: 3s
11+
retries: 3
12+
ports:
13+
- "5432"
14+
labels:
15+
io.quarkus.devservices.compose.config_map.port.5432: quarkus.datasource.jdbc.port
16+
environment:
17+
- POSTGRES_USER=root
18+
- POSTGRES_PASSWORD=password
19+
- POSTGRES_DB=dummy
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
db:
3+
image: postgres:18
4+
command: "postgres -c checkpoint_timeout=10min -c fsync=off -c full_page_writes=off -c max_wal_size=2GB -c synchronous_commit=off"
5+
tmpfs:
6+
- /var/lib/postgresql/18/docker
7+
healthcheck:
8+
test: pg_isready -U root -d dummy
9+
interval: 3s
10+
timeout: 3s
11+
retries: 3
12+
ports:
13+
- "5432"
14+
labels:
15+
io.quarkus.devservices.compose.config_map.port.5432: quarkus.datasource.jdbc.port
16+
environment:
17+
- POSTGRES_USER=root
18+
- POSTGRES_PASSWORD=password
19+
- POSTGRES_DB=dummy

operator/src/main/java/it/aboutbits/postgresql/core/Privilege.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public enum Privilege {
2323
CREATE,
2424
CONNECT,
2525
TEMPORARY,
26-
USAGE,
27-
MAINTAIN;
26+
USAGE;
27+
//MAINTAIN; // PostgreSQL 17+
2828

2929
@JsonValue
3030
public String toValue() {

operator/src/main/java/it/aboutbits/postgresql/crd/defaultprivilege/DefaultPrivilegeObjectType.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import static it.aboutbits.postgresql.core.Privilege.CREATE;
1515
import static it.aboutbits.postgresql.core.Privilege.DELETE;
1616
import static it.aboutbits.postgresql.core.Privilege.INSERT;
17-
import static it.aboutbits.postgresql.core.Privilege.MAINTAIN;
1817
import static it.aboutbits.postgresql.core.Privilege.REFERENCES;
1918
import static it.aboutbits.postgresql.core.Privilege.SELECT;
2019
import static it.aboutbits.postgresql.core.Privilege.TRIGGER;
@@ -48,8 +47,8 @@ public enum DefaultPrivilegeObjectType {
4847
DELETE,
4948
TRUNCATE,
5049
REFERENCES,
51-
TRIGGER,
52-
MAINTAIN
50+
TRIGGER
51+
//MAINTAIN // PostgreSQL 17+
5352
)
5453
),
5554
SEQUENCE(

operator/src/main/java/it/aboutbits/postgresql/crd/defaultprivilege/DefaultPrivilegeSpec.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ public class DefaultPrivilegeSpec {
102102
/// - `trigger`
103103
/// - `create`
104104
/// - `usage`
105-
/// - `maintain`
106105
@Required
107106
@JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_VALUES)
108107
@ValidationRule(

operator/src/main/java/it/aboutbits/postgresql/crd/grant/GrantObjectType.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import static it.aboutbits.postgresql.core.Privilege.CREATE;
1616
import static it.aboutbits.postgresql.core.Privilege.DELETE;
1717
import static it.aboutbits.postgresql.core.Privilege.INSERT;
18-
import static it.aboutbits.postgresql.core.Privilege.MAINTAIN;
1918
import static it.aboutbits.postgresql.core.Privilege.REFERENCES;
2019
import static it.aboutbits.postgresql.core.Privilege.SELECT;
2120
import static it.aboutbits.postgresql.core.Privilege.TEMPORARY;
@@ -55,8 +54,8 @@ public enum GrantObjectType {
5554
DELETE,
5655
TRUNCATE,
5756
REFERENCES,
58-
TRIGGER,
59-
MAINTAIN
57+
TRIGGER
58+
//MAINTAIN // PostgreSQL 17+
6059
)
6160
),
6261
SEQUENCE(

operator/src/main/java/it/aboutbits/postgresql/crd/grant/GrantSpec.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public class GrantSpec {
105105
/// - `connect`
106106
/// - `temporary`
107107
/// - `usage`
108-
/// - `maintain`
109108
@Required
110109
@JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_VALUES)
111110
@ValidationRule(

0 commit comments

Comments
 (0)