From 2548b921534c28d0c2593195f1abe67aabd55f82 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Thu, 25 Apr 2024 19:11:17 +0200 Subject: [PATCH] fix: replace update with patch calls Signed-off-by: Chris Laprun --- .../java/io/quarkiverse/operatorsdk/it/SecretReconciler.java | 2 +- .../src/main/java/io/halkyon/ExposedAppReconciler.java | 2 +- .../operatorsdk/samples/joke/JokeRequestReconciler.java | 2 +- .../samples/mysqlschema/MySQLSchemaReconciler.java | 4 ++-- .../operatorsdk/samples/pingpong/PingReconciler.java | 2 +- .../operatorsdk/samples/pingpong/PongReconciler.java | 3 ++- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/integration-tests/src/main/java/io/quarkiverse/operatorsdk/it/SecretReconciler.java b/integration-tests/src/main/java/io/quarkiverse/operatorsdk/it/SecretReconciler.java index 31ce4aab..99f56dce 100644 --- a/integration-tests/src/main/java/io/quarkiverse/operatorsdk/it/SecretReconciler.java +++ b/integration-tests/src/main/java/io/quarkiverse/operatorsdk/it/SecretReconciler.java @@ -27,7 +27,7 @@ public UpdateControl reconcile(Secret secret, Context context) { final String foo = data.putIfAbsent("quarkus-operator-sdk.added-value", Base64.getEncoder().encodeToString("quarkus-operator-sdk rocks!".getBytes())); if (foo == null) { - return UpdateControl.updateResource(secret); + return UpdateControl.patchResource(secret); } } } diff --git a/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java b/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java index 1d9e4c51..c2db5991 100644 --- a/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java +++ b/samples/exposedapp/src/main/java/io/halkyon/ExposedAppReconciler.java @@ -49,7 +49,7 @@ public UpdateControl reconcile(ExposedApp exposedApp, Context reconcile(JokeRequest jr, Context } jr.setStatus(status); - return UpdateControl.updateStatus(jr); + return UpdateControl.patchStatus(jr); } } diff --git a/samples/mysql-schema/src/main/java/io/quarkiverse/operatorsdk/samples/mysqlschema/MySQLSchemaReconciler.java b/samples/mysql-schema/src/main/java/io/quarkiverse/operatorsdk/samples/mysqlschema/MySQLSchemaReconciler.java index 4fd70b3d..b7df861c 100644 --- a/samples/mysql-schema/src/main/java/io/quarkiverse/operatorsdk/samples/mysqlschema/MySQLSchemaReconciler.java +++ b/samples/mysql-schema/src/main/java/io/quarkiverse/operatorsdk/samples/mysqlschema/MySQLSchemaReconciler.java @@ -42,7 +42,7 @@ public UpdateControl reconcile(MySQLSchema schema, Context updateErrorStatus(MySQLSchema schem status.setStatus("ERROR: " + e.getMessage()); schema.setStatus(status); - return ErrorStatusUpdateControl.updateStatus(schema); + return ErrorStatusUpdateControl.patchStatus(schema); } private void updateStatusPojo(MySQLSchema schema, String secretName, String userName) { diff --git a/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PingReconciler.java b/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PingReconciler.java index 33258393..24d5f485 100644 --- a/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PingReconciler.java +++ b/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PingReconciler.java @@ -48,6 +48,6 @@ public UpdateControl reconcile(Ping ping, Context context) { } ping.setStatus(new Status(Status.State.PROCESSED)); - return UpdateControl.updateStatus(ping); + return UpdateControl.patchStatus(ping); } } diff --git a/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PongReconciler.java b/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PongReconciler.java index 0c65670d..bf1a1a3e 100644 --- a/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PongReconciler.java +++ b/samples/pingpong/src/main/java/io/quarkiverse/operatorsdk/samples/pingpong/PongReconciler.java @@ -21,6 +21,7 @@ import io.javaoperatorsdk.operator.api.reconciler.Reconciler; import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; +@SuppressWarnings("unused") @ControllerConfiguration(namespaces = WATCH_CURRENT_NAMESPACE) public class PongReconciler implements Reconciler { @@ -32,6 +33,6 @@ public UpdateControl reconcile(Pong pong, Context context) { } pong.setStatus(new Status(Status.State.PROCESSED)); - return UpdateControl.updateStatus(pong); + return UpdateControl.patchStatus(pong); } }