You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/en/docs/documentation/reconciler.md
+60-1Lines changed: 60 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,4 +258,63 @@ In this mode:
258
258
- you cannot use managed dependent resources since those manage the finalizers and other logic related to the normal
259
259
execution mode.
260
260
261
-
See also [sample](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/triggerallevent/finalizerhandling) for selectively adding finalizers for resources;
261
+
See also [sample](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/triggerallevent/finalizerhandling) for selectively adding finalizers for resources;
262
+
263
+
### Expectations
264
+
265
+
Expectations are a pattern to make sure to check in the reconciliation that your secondary resources are in a certain state.
266
+
For a more detailed explanation see [this blogpost](https://ahmet.im/blog/controller-pitfalls/#expectations-pattern).
267
+
You can find framework support for this pattern in [`io.javaoperatorsdk.operator.processing.expectation`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/expectation/)
268
+
package. See also related [integration test](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/expectation/ExpectationReconciler.java).
269
+
Note that this feature is marked as `@Experimental`, since based on feedback the API might be improved / changed, but we intend
270
+
to support it, later also might be integrated to Dependent Resources and/or Workflows.
271
+
272
+
The idea is the nutshell, is that you can track your expectations in the expectation manager in the reconciler.
273
+
Which has an api that covers the common use cases.
274
+
275
+
The following sample is the simplified version of the integration tests that implements a logic that creates a
276
+
deployment and sets status message if there are the target three replicas ready:
Copy file name to clipboardExpand all lines: operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/expectation/ExpectationReconciler.java
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -72,17 +72,24 @@ public UpdateControl<ExpectationCustomResource> reconcile(
0 commit comments