Skip to content

Commit 878c71c

Browse files
committed
improve: add information about SSA use to the debug logs (operator-framework#2914)
Signed-off-by: xstefank <[email protected]>
1 parent 50f637d commit 878c71c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,17 @@ public R create(R desired, P primary, Context<P> context) {
8181
}
8282

8383
public R update(R actual, R desired, P primary, Context<P> context) {
84+
boolean useSSA = useSSA(context);
8485
if (log.isDebugEnabled()) {
8586
log.debug(
86-
"Updating actual resource: {} version: {}",
87+
"Updating actual resource: {} version: {}; SSA: {}",
8788
ResourceID.fromResource(actual),
88-
actual.getMetadata().getResourceVersion());
89+
actual.getMetadata().getResourceVersion(),
90+
useSSA);
8991
}
9092
R updatedResource;
9193
addMetadata(false, actual, desired, primary, context);
92-
if (useSSA(context)) {
94+
if (useSSA) {
9395
updatedResource =
9496
prepare(context, desired, primary, "Updating")
9597
.fieldManager(context.getControllerConfiguration().fieldManager())

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,11 @@ private P updateCustomResourceWithFinalizer(P resourceForExecution, P originalRe
341341
}
342342

343343
private P patchResource(P resource, P originalResource) {
344-
log.debug("Updating resource: {} with version: {}", getUID(resource), getVersion(resource));
344+
log.debug(
345+
"Updating resource: {} with version: {}; SSA: {}",
346+
getUID(resource),
347+
getVersion(resource),
348+
useSSA);
345349
log.trace("Resource before update: {}", resource);
346350

347351
final var finalizerName = configuration().getFinalizerName();

0 commit comments

Comments
 (0)