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/workflows/_index.md
+16-1
Original file line number
Diff line number
Diff line change
@@ -49,11 +49,26 @@ reconciliation process.
49
49
See related [integration test](https://github.com/operator-framework/java-operator-sdk/blob/ba5e33527bf9e3ea0bd33025ccb35e677f9d44b4/operator-framework/src/test/java/io/javaoperatorsdk/operator/CRDPresentActivationConditionIT.java).
50
50
51
51
To have multiple resources of same type with an activation condition is a bit tricky, since you
52
-
don't want to have multiple `InformerEvetnSource` for the same type, you have to explicitly
52
+
don't want to have multiple `InformerEventSource` for the same type, you have to explicitly
53
53
name the informer for the Dependent Resource (`@KubernetesDependent(informerConfig = @InformerConfig(name = "configMapInformer"))`)
54
54
for all resource of same type with activation condition. This will make sure that only one is registered.
55
55
See details at [low level api](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSourceRetriever.java#L20-L52).
56
56
57
+
### Result conditions
58
+
59
+
While simple conditions are usually enough, it might happen you want to convey extra information as a result of the
60
+
evaluation of the conditions (e.g., to report error messages or because the result of the condition evaluation might be
61
+
interesting for other purposes). In this situation, you should implement `DetailedCondition` instead of `Condition` and
62
+
provide an implementation of the `detailedIsMet` method, which allows you to return a more detailed `Result` object via
63
+
which you can provide extra information. The `DetailedCondition.Result` interface provides factory method for your
64
+
convenience but you can also provide your own implementation if required.
65
+
66
+
You can access the results for conditions from the `WorkflowResult` instance that is returned whenever a workflow is
67
+
evaluated. You can access that result from the `ManagedWorkflowAndDependentResourceContext` accessible from the
68
+
reconciliation `Context`. You can then access individual condition results using the `
69
+
getDependentConditionResult` methods. You can see an example of this
70
+
in [this integration test](https://github.com/operator-framework/java-operator-sdk/blob/fd0e92c0de55c47d5df50658cf4e147ee5e6102d/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/workflowallfeature/WorkflowAllFeatureReconciler.java#L44-L49).
71
+
57
72
## Defining Workflows
58
73
59
74
Similarly to dependent resources, there are two ways to define workflows, in managed and standalone
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/AbstractWorkflowExecutor.java
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/Condition.java
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/DefaultWorkflow.java
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/DependentResourceNode.java
+24-20
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,10 @@ class DependentResourceNode<R, P extends HasMetadata> {
0 commit comments