From be3af52da4893849e45156fffbdf747db55c5f95 Mon Sep 17 00:00:00 2001 From: csviri Date: Mon, 28 Aug 2023 09:38:35 +0200 Subject: [PATCH 1/2] improve: logging if no primary found for resource id --- .../operator/processing/event/EventProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java index cef5e0ac45..581f50554b 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java @@ -146,7 +146,7 @@ private void submitReconciliationExecution(ResourceState state) { controllerUnderExecution, maybeLatest.isPresent()); if (maybeLatest.isEmpty()) { - log.debug("no custom resource found in cache for resource id: {}", resourceID); + log.debug("no primary resource found in cache with resource id: {}", resourceID); } } } finally { From eba502e4ec003e2bb4fa1a47ab8b7daa616192b1 Mon Sep 17 00:00:00 2001 From: csviri Date: Mon, 28 Aug 2023 15:03:18 +0200 Subject: [PATCH 2/2] comment on debug log --- .../operator/processing/event/EventProcessor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java index 581f50554b..833e10816d 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventProcessor.java @@ -146,6 +146,11 @@ private void submitReconciliationExecution(ResourceState state) { controllerUnderExecution, maybeLatest.isPresent()); if (maybeLatest.isEmpty()) { + // there can be multiple reasons why the primary resource is not present, one is that the + // informer is currently disconnected from k8s api server, but will eventually receive the + // resource. Other is that simply there is no primary resource present for an event, this + // might indicate issue with the implementation, but could happen also naturally, thus + // this is not necessarily a problem. log.debug("no primary resource found in cache with resource id: {}", resourceID); } }