Skip to content

Commit d4137a9

Browse files
authored
fix: ResourceId toString (#1072)
1 parent f2b6a1a commit d4137a9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void eventProcessingFinished(
182182
if (!running) {
183183
return;
184184
}
185-
ResourceID resourceID = executionScope.getCustomResourceID();
185+
ResourceID resourceID = executionScope.getResourceID();
186186
log.debug(
187187
"Event processing finished. Scope: {}, PostExecutionControl: {}",
188188
executionScope,
@@ -202,7 +202,7 @@ void eventProcessingFinished(
202202
cleanupOnSuccessfulExecution(executionScope);
203203
metrics.finishedReconciliation(resourceID);
204204
if (eventMarker.deleteEventPresent(resourceID)) {
205-
cleanupForDeletedEvent(executionScope.getCustomResourceID());
205+
cleanupForDeletedEvent(executionScope.getResourceID());
206206
} else {
207207
postExecutionControl.getUpdatedCustomResource().ifPresent(
208208
r -> eventSourceManager.getControllerResourceEventSource().handleRecentResourceUpdate(
@@ -244,7 +244,7 @@ TimerEventSource<R> retryEventSource() {
244244
private void handleRetryOnException(
245245
ExecutionScope<R> executionScope, Exception exception) {
246246
RetryExecution execution = getOrInitRetryExecution(executionScope);
247-
var customResourceID = executionScope.getCustomResourceID();
247+
var customResourceID = executionScope.getResourceID();
248248
boolean eventPresent = eventMarker.eventPresent(customResourceID);
249249
eventMarker.markEventReceived(customResourceID);
250250

@@ -271,16 +271,16 @@ private void cleanupOnSuccessfulExecution(ExecutionScope<R> executionScope) {
271271
log.debug(
272272
"Cleanup for successful execution for resource: {}", getName(executionScope.getResource()));
273273
if (isRetryConfigured()) {
274-
retryState.remove(executionScope.getCustomResourceID());
274+
retryState.remove(executionScope.getResourceID());
275275
}
276-
retryEventSource().cancelOnceSchedule(executionScope.getCustomResourceID());
276+
retryEventSource().cancelOnceSchedule(executionScope.getResourceID());
277277
}
278278

279279
private RetryExecution getOrInitRetryExecution(ExecutionScope<R> executionScope) {
280-
RetryExecution retryExecution = retryState.get(executionScope.getCustomResourceID());
280+
RetryExecution retryExecution = retryState.get(executionScope.getResourceID());
281281
if (retryExecution == null) {
282282
retryExecution = retry.initExecution();
283-
retryState.put(executionScope.getCustomResourceID(), retryExecution);
283+
retryState.put(executionScope.getResourceID(), retryExecution);
284284
}
285285
return retryExecution;
286286
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public R getResource() {
1818
return resource;
1919
}
2020

21-
public ResourceID getCustomResourceID() {
21+
public ResourceID getResourceID() {
2222
return ResourceID.fromResource(resource);
2323
}
2424

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public int hashCode() {
6161

6262
@Override
6363
public String toString() {
64-
return "CustomResourceID{" +
64+
return "ResourceID{" +
6565
"name='" + name + '\'' +
6666
", namespace='" + namespace + '\'' +
6767
'}';

0 commit comments

Comments
 (0)