Skip to content

Commit a2bf2e4

Browse files
authored
docs: fix dependent resource sample docs (#2822)
1 parent e961dcb commit a2bf2e4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/content/en/docs/documentation/dependent-resource-and-workflows/dependent-resources.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Deleted (or set to be garbage collected). The following example shows how to cre
133133

134134
```java
135135

136-
@KubernetesDependent(labelSelector = WebPageManagedDependentsReconciler.SELECTOR)
136+
@KubernetesDependent(informer = @Informer(labelSelector = SELECTOR))
137137
class DeploymentDependentResource extends CRUDKubernetesDependentResource<Deployment, WebPage> {
138138

139139
@Override
@@ -174,7 +174,8 @@ JOSDK will take the appropriate steps to wire everything together and call your
174174
`DependentResource` implementations `reconcile` method before your primary resource is reconciled.
175175
This makes sense in most use cases where the logic associated with the primary resource is
176176
usually limited to status handling based on the state of the secondary resources and the
177-
resources are not dependent on each other.
177+
resources are not dependent on each other. As an alternative, you can also invoke reconciliation explicitly,
178+
event for managed workflows.
178179

179180
See [Workflows](https://javaoperatorsdk.io/docs/workflows) for more details on how the dependent
180181
resources are reconciled.
@@ -184,12 +185,14 @@ instances are managed by JOSDK, an example of which can be seen below:
184185

185186
```java
186187

187-
@ControllerConfiguration(
188-
labelSelector = SELECTOR,
188+
@Workflow(
189189
dependents = {
190190
@Dependent(type = ConfigMapDependentResource.class),
191191
@Dependent(type = DeploymentDependentResource.class),
192-
@Dependent(type = ServiceDependentResource.class)
192+
@Dependent(type = ServiceDependentResource.class),
193+
@Dependent(
194+
type = IngressDependentResource.class,
195+
reconcilePrecondition = ExposedIngressCondition.class)
193196
})
194197
public class WebPageManagedDependentsReconciler
195198
implements Reconciler<WebPage>, ErrorStatusHandler<WebPage> {
@@ -204,7 +207,6 @@ public class WebPageManagedDependentsReconciler
204207
webPage.setStatus(createStatus(name));
205208
return UpdateControl.patchStatus(webPage);
206209
}
207-
208210
}
209211
```
210212

0 commit comments

Comments
 (0)