Skip to content

Commit bf78b07

Browse files
committed
be consistent with the log messages and use DSL.role() instead of DSL.name() where possible
1 parent 0857af1 commit bf78b07

4 files changed

Lines changed: 18 additions & 7 deletions

File tree

generated/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ jooq {
4747
| pg_auth_members
4848
| pg_authid
4949
| pg_db_role_setting
50+
51+
| pg_database
52+
| pg_namespace
53+
| pg_class
54+
| pg_proc
55+
| pg_foreign_data_wrapper
56+
| pg_foreign_server
57+
| pg_type
58+
| pg_language
59+
| pg_parameter_acl
60+
| pg_tablespace
61+
5062
| shobj_description
5163
""".trimIndent()
5264
excludes = """

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public Optional<ClusterConnection> getReferencedClusterConnection(
6262
//noinspection ConstantConditions
6363
if (clusterConnection == null) {
6464
log.error(
65-
"The specified ClusterConnection does not exist [clusterConnection={}/{}]",
65+
"The specified ClusterConnection does not exist [resource={}/{}]",
6666
connectionNamespace,
6767
connectionName
6868
);
@@ -75,7 +75,7 @@ public Optional<ClusterConnection> getReferencedClusterConnection(
7575

7676
if (!Objects.equals(currentPhase, expectedPhase)) {
7777
log.warn(
78-
"The specified ClusterConnection is not ready yet [clusterConnection={}/{}]",
78+
"The specified ClusterConnection is not ready yet [resource={}/{}]",
7979
connectionNamespace,
8080
connectionName
8181
);

operator/src/main/java/it/aboutbits/postgresql/crd/role/RoleReconciler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public UpdateControl<Role> reconcile(
7171

7272
if (clusterConnectionOptional.isEmpty()) {
7373
status.setPhase(CRPhase.PENDING)
74-
.setMessage("The specified ClusterConnection does not exist or is not ready yet [clusterRef=%s/%s]".formatted(
74+
.setMessage("The specified ClusterConnection does not exist or is not ready yet [resource=%s/%s]".formatted(
7575
getResourceNamespaceOrOwn(resource, clusterRef.getNamespace()),
7676
clusterRef.getName()
7777
));
@@ -155,7 +155,7 @@ public DeleteControl cleanup(
155155
);
156156

157157
if (clusterConnectionOptional.isEmpty()) {
158-
status.setMessage("The specified ClusterConnection no longer exists or is not ready yet [clusterRef=%s/%s]".formatted(
158+
status.setMessage("The specified ClusterConnection no longer exists or is not ready yet [resource=%s/%s]".formatted(
159159
getResourceNamespaceOrOwn(resource, clusterRef.getNamespace()),
160160
clusterRef.getName()
161161
));
@@ -179,7 +179,7 @@ public DeleteControl cleanup(
179179
status.getPhase()
180180
);
181181

182-
status.setMessage("Deletion failed: " + e.getMessage());
182+
status.setMessage("Deletion failed: %s".formatted(e.getMessage()));
183183

184184
return DeleteControl.noFinalizerRemoval()
185185
.rescheduleAfter(60, TimeUnit.SECONDS);

operator/src/main/java/it/aboutbits/postgresql/crd/role/RoleService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.jooq.impl.DSL.field;
2121
import static org.jooq.impl.DSL.keyword;
2222
import static org.jooq.impl.DSL.multiset;
23-
import static org.jooq.impl.DSL.name;
2423
import static org.jooq.impl.DSL.query;
2524
import static org.jooq.impl.DSL.role;
2625
import static org.jooq.impl.DSL.select;
@@ -419,7 +418,7 @@ private static Query buildCommentOnRole(
419418
) {
420419
return query(
421420
"comment on role {0} is {1}",
422-
name(roleName),
421+
role(roleName),
423422
val(comment)
424423
);
425424
}

0 commit comments

Comments
 (0)