Skip to content

Commit 7b72d35

Browse files
committed
naming
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 7a8d78f commit 7b72d35

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Context.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ default <R> Stream<R> getSecondaryResourcesAsStream(Class<R> expectedType) {
7373
*/
7474
boolean isNextReconciliationImminent();
7575

76-
boolean isDeleteEventPresent();
76+
boolean isPrimaryResourceDeleted();
7777

78-
boolean isDeleteFinalStateUnknown();
78+
boolean isPrimaryResourceFinalStateUnknown();
7979
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ public class DefaultContext<P extends HasMetadata> implements Context<P> {
2424
private final ControllerConfiguration<P> controllerConfiguration;
2525
private final DefaultManagedWorkflowAndDependentResourceContext<P>
2626
defaultManagedDependentResourceContext;
27-
private final boolean isDeleteEventPresent;
28-
private final boolean isDeleteFinalStateUnknown;
27+
private final boolean primaryResourceDeleted;
28+
private final boolean primaryResourceFinalStateUnknown;
2929

3030
public DefaultContext(
3131
RetryInfo retryInfo,
3232
Controller<P> controller,
3333
P primaryResource,
34-
boolean isDeleteEventPresent,
35-
boolean isDeleteFinalStateUnknown) {
34+
boolean primaryResourceDeleted,
35+
boolean primaryResourceFinalStateUnknown) {
3636
this.retryInfo = retryInfo;
3737
this.controller = controller;
3838
this.primaryResource = primaryResource;
3939
this.controllerConfiguration = controller.getConfiguration();
40-
this.isDeleteEventPresent = isDeleteEventPresent;
41-
this.isDeleteFinalStateUnknown = isDeleteFinalStateUnknown;
40+
this.primaryResourceDeleted = primaryResourceDeleted;
41+
this.primaryResourceFinalStateUnknown = primaryResourceFinalStateUnknown;
4242
this.defaultManagedDependentResourceContext =
4343
new DefaultManagedWorkflowAndDependentResourceContext<>(controller, primaryResource, this);
4444
}
@@ -129,13 +129,13 @@ public boolean isNextReconciliationImminent() {
129129
}
130130

131131
@Override
132-
public boolean isDeleteEventPresent() {
133-
return isDeleteEventPresent;
132+
public boolean isPrimaryResourceDeleted() {
133+
return primaryResourceDeleted;
134134
}
135135

136136
@Override
137-
public boolean isDeleteFinalStateUnknown() {
138-
return isDeleteFinalStateUnknown;
137+
public boolean isPrimaryResourceFinalStateUnknown() {
138+
return primaryResourceFinalStateUnknown;
139139
}
140140

141141
public DefaultContext<P> setRetryInfo(RetryInfo retryInfo) {

operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/propagateallevent/onlyreconcile/PropagateEventReconciler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,22 @@ public UpdateControl<PropagateAllEventCustomResource> reconcile(
7171
throw new RuntimeException("On purpose exception for missing annotation");
7272
}
7373

74-
if (primary.isMarkedForDeletion() && !context.isDeleteEventPresent()) {
74+
if (primary.isMarkedForDeletion() && !context.isPrimaryResourceDeleted()) {
7575
setEventOnMarkedForDeletion(true);
7676
if (getUseFinalizer() && primary.hasFinalizer(FINALIZER)) {
7777
log.info("Removing finalizer");
7878
FinalizerUtils.removeFinalizer(primary, FINALIZER, context);
7979
}
8080
}
8181

82-
if (context.isDeleteEventPresent()
82+
if (context.isPrimaryResourceDeleted()
8383
&& isFirstDeleteEvent()
8484
&& isThrowExceptionOnFirstDeleteEvent()) {
8585
isFirstDeleteEvent = false;
8686
throw new RuntimeException("On purpose exception");
8787
}
8888

89-
if (context.isDeleteEventPresent()) {
89+
if (context.isPrimaryResourceDeleted()) {
9090
setDeleteEventPresent(true);
9191
}
9292
log.info("Reconciliation finished");

0 commit comments

Comments
 (0)