Skip to content

docs: fix dependent resource sample docs #2822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Deleted (or set to be garbage collected). The following example shows how to cre

```java

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

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

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

```java

@ControllerConfiguration(
labelSelector = SELECTOR,
@Workflow(
dependents = {
@Dependent(type = ConfigMapDependentResource.class),
@Dependent(type = DeploymentDependentResource.class),
@Dependent(type = ServiceDependentResource.class)
@Dependent(type = ServiceDependentResource.class),
@Dependent(
type = IngressDependentResource.class,
reconcilePrecondition = ExposedIngressCondition.class)
})
public class WebPageManagedDependentsReconciler
implements Reconciler<WebPage>, ErrorStatusHandler<WebPage> {
Expand All @@ -204,7 +207,6 @@ public class WebPageManagedDependentsReconciler
webPage.setStatus(createStatus(name));
return UpdateControl.patchStatus(webPage);
}

}
```

Expand Down