Skip to content

Commit b91ca52

Browse files
committed
fix: typos and wrong logged information
1 parent 7382aeb commit b91ca52

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ private void handleMarkedEventForResource(ResourceState state) {
135135
private void submitReconciliationExecution(ResourceState state) {
136136
try {
137137
boolean controllerUnderExecution = isControllerUnderExecution(state);
138-
Optional<R> maybeLatest = cache.get(state.getId());
138+
final var resourceID = state.getId();
139+
Optional<R> maybeLatest = cache.get(resourceID);
139140
maybeLatest.ifPresent(MDCUtils::addResourceInfo);
140141
if (!controllerUnderExecution && maybeLatest.isPresent()) {
141142
var rateLimit = state.getRateLimit();
@@ -145,24 +146,24 @@ private void submitReconciliationExecution(ResourceState state) {
145146
}
146147
var rateLimiterPermission = rateLimiter.isLimited(rateLimit);
147148
if (rateLimiterPermission.isPresent()) {
148-
handleRateLimitedSubmission(state.getId(), rateLimiterPermission.get());
149+
handleRateLimitedSubmission(resourceID, rateLimiterPermission.get());
149150
return;
150151
}
151152
state.setUnderProcessing(true);
152153
final var latest = maybeLatest.get();
153154
ExecutionScope<R> executionScope = new ExecutionScope<>(latest, state.getRetry());
154155
state.unMarkEventReceived();
155-
metrics.reconcileCustomResource(state.getId(), state.getRetry(), metricsMetadata);
156+
metrics.reconcileCustomResource(resourceID, state.getRetry(), metricsMetadata);
156157
log.debug("Executing events for custom resource. Scope: {}", executionScope);
157158
executor.execute(new ReconcilerExecutor(executionScope));
158159
} else {
159160
log.debug(
160161
"Skipping executing controller for resource id: {}. Controller in execution: {}. Latest Resource present: {}",
161-
state,
162+
resourceID,
162163
controllerUnderExecution,
163164
maybeLatest.isPresent());
164165
if (maybeLatest.isEmpty()) {
165-
log.debug("no custom resource found in cache for ResourceID: {}", state);
166+
log.debug("no custom resource found in cache for resource id: {}", resourceID);
166167
}
167168
}
168169
} finally {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
public interface ResourceEventSource<R, P extends HasMetadata> extends EventSource {
1313

1414
/**
15-
* Retrieves the resource type associated with this ResourceOwner
15+
* Retrieves the resource type associated with this ResourceEventSource
1616
*
17-
* @return the resource type associated with this ResourceOwner
17+
* @return the resource type associated with this ResourceEventSource
1818
*/
1919
Class<R> resourceType();
2020

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/ManagedInformerEventSource.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public void handleRecentResourceCreate(ResourceID resourceID, R resource) {
9393
public Optional<R> get(ResourceID resourceID) {
9494
Optional<R> resource = temporaryResourceCache.getResourceFromCache(resourceID);
9595
if (resource.isPresent()) {
96-
log.debug("Resource found in temporal cache for Resource ID: {}", resourceID);
96+
log.debug("Resource found in temporary cache for Resource ID: {}", resourceID);
9797
return resource;
9898
} else {
99-
log.debug("Resource not found in temporal cache reading it from informer cache," +
99+
log.debug("Resource not found in temporary cache reading it from informer cache," +
100100
" for Resource ID: {}", resourceID);
101101
return cache.get(resourceID);
102102
}

0 commit comments

Comments
 (0)