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
In this mode workflow is built manually using [standalone dependent resources](https://javaoperatorsdk.io/docs/dependent-resources#standalone-dependent-resources)
95
+
. The workflow is created using a builder, that is explicitly called in the reconciler (from web page sample):
var result = workflow.reconcile(webPage, context);
137
+
138
+
webPage.setStatus(createStatus(result));
139
+
returnUpdateControl.patchStatus(webPage);
140
+
}
141
+
// emitted code
142
+
}
143
+
144
+
```
145
+
146
+
## Workflow Execution
147
+
148
+
This section describes how a workflow is executed in details, how is the ordering determined and how condition and
149
+
errors effect behavior. The workflow execution as also its API denotes, can be divided to into two parts,
150
+
the reconciliation and cleanup. [Cleanup](https://javaoperatorsdk.io/docs/features#the-reconcile-and-cleanup) is
151
+
executed if a resource is marked for deletion.
152
+
153
+
154
+
## Common Principles
155
+
156
+
-**As complete as possible execution** - when a workflow is reconciled, it tries to reconcile as many resources as
157
+
possible. Thus is an error happens or a ready condition is not met for a resources, all the other independent resources
158
+
will be still reconciled. So this is exactly the opposite of fail-fast approach. The assumption is that in this way
159
+
the overall desired state is achieved faster than with a fail fast approach.
160
+
-**Concurrent reconciliation of independent resources** - the resources which are not dependent on each are processed
161
+
concurrently. The level of concurrency is customizable, could be set to one if required. By default, workflows use
162
+
the executor service from [ConfigurationService](https://github.com/java-operator-sdk/java-operator-sdk/blob/6f2a252952d3a91f6b0c3c38e5e6cc28f7c0f7b3/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L120-L120)
163
+
164
+
## Reconciliation
165
+
166
+
This section describes how a workflow is executed, first the rules are defined, then are explained on samples:
167
+
168
+
### Rules
169
+
170
+
1. DR is reconciled if it does not depend on another DR, or ALL the DRs it depends on are ready. In case it
171
+
has a reconcile-precondition that must met too. (Ready means that it is successfully reconciled - without any error - and
172
+
if it has a ready condition that is met).
173
+
2. If a reconcile-precondition of a DR is not met, it is deleted. If there are dependent resources which depends on it
174
+
are deleted first too - this applies recursively. That means that DRs are always deleted in revers order compared
175
+
how are reconciled.
176
+
3. Delete is called on a dependent resource if as described in point 2. it (possibly transitively) depends on A DR which
177
+
did not meet it's reconcile condition, and has not DRs depends on it, or if the DR-s which depends on it are
178
+
successfully deleted. "Delete is called" means, that the dependent resource is checked if it implements `Deleter` interface,
179
+
if implements it but do not implement `GarbageCollected` interface, the `Deleter.delete` method called. If a DR
180
+
does not implement `Deleter` interface, it is considered as deleted automatically. Successfully deleted means,
181
+
that it is deleted and if a delete-postcondition is present it is met.
182
+
183
+
### Samples
49
184
50
-
## Reconciliation
51
185
52
-
[//]: #(todo mention parallelism)
53
186
54
187
## Cleanup
55
188
189
+
## Error Handling
190
+
56
191
## Notes
57
192
58
193
- Workflows can be seen as a Directed Acyclic Graph (DAG) - or more precisely a set of DAGs - where nodes are the
59
194
dependent resources and edges are the dependencies.
0 commit comments