Skip to content

Commit 9f60ed8

Browse files
committed
wip
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 09b90de commit 9f60ed8

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import io.fabric8.kubernetes.api.model.HasMetadata;
77
import io.fabric8.kubernetes.client.KubernetesClient;
88
import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.ManagedWorkflowAndDependentResourceContext;
9+
import io.javaoperatorsdk.operator.api.reconciler.expectation.ExpectationResult;
910
import io.javaoperatorsdk.operator.processing.event.source.IndexerResourceCache;
1011

1112
public interface Context<P extends HasMetadata> extends CacheAware<P> {
@@ -52,4 +53,6 @@ public interface Context<P extends HasMetadata> extends CacheAware<P> {
5253
* @return {@code true} is another reconciliation is already scheduled, {@code false} otherwise
5354
*/
5455
boolean isNextReconciliationImminent();
56+
57+
Optional<ExpectationResult> expectationResult();
5558
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import io.javaoperatorsdk.operator.api.config.ControllerConfiguration;
1212
import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.DefaultManagedWorkflowAndDependentResourceContext;
1313
import io.javaoperatorsdk.operator.api.reconciler.dependent.managed.ManagedWorkflowAndDependentResourceContext;
14+
import io.javaoperatorsdk.operator.api.reconciler.expectation.ExpectationResult;
1415
import io.javaoperatorsdk.operator.processing.Controller;
1516
import io.javaoperatorsdk.operator.processing.event.EventSourceRetriever;
1617
import io.javaoperatorsdk.operator.processing.event.NoEventSourceForClassException;
@@ -119,6 +120,11 @@ public boolean isNextReconciliationImminent() {
119120
.isNextReconciliationImminent(ResourceID.fromResource(primaryResource));
120121
}
121122

123+
@Override
124+
public Optional<ExpectationResult> expectationResult() {
125+
return Optional.empty();
126+
}
127+
122128
public DefaultContext<P> setRetryInfo(RetryInfo retryInfo) {
123129
this.retryInfo = retryInfo;
124130
return this;

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
public class ExpectationResult {
44

5-
private ExpectationStatus status;
5+
private ExpectationStatus status;
66

7-
public ExpectationResult(ExpectationStatus status) {
8-
this.status = status;
9-
}
7+
public ExpectationResult(ExpectationStatus status) {
8+
this.status = status;
9+
}
1010

11-
public ExpectationStatus getStatus() {
12-
return status;
13-
}
11+
public ExpectationStatus getStatus() {
12+
return status;
13+
}
1414
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.javaoperatorsdk.operator.api.reconciler.expectation;
22

33
public enum ExpectationStatus {
4-
TIMEOUT,
5-
FULFILLED;
4+
TIMEOUT,
5+
FULFILLED;
66
}

0 commit comments

Comments
 (0)