Skip to content

Commit b2fb1ec

Browse files
authored
doc: Kubernetes DR fix target resource seletion description (#2611)
1 parent dfe49ca commit b2fb1ec

File tree

1 file changed

+8
-7
lines changed
  • docs/content/en/docs/dependent-resources

1 file changed

+8
-7
lines changed

Diff for: docs/content/en/docs/dependent-resources/_index.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -304,17 +304,18 @@ resource matching the desired state associated with the primary resource. This m
304304
state computation already needs to be able to discriminate among multiple related secondary resources to tell JOSDK how
305305
they should be reconciled.
306306

307-
There might be casees, though, where it might be problematic to call the `desired` method several times (for example, because it is costly to do so), it is always possible to override this automated discrimination using several means:
307+
There might be cases, though, where it might be problematic to call the `desired` method several times (for example, because it is costly to do so),
308+
it is always possible to override this automated discrimination using several means (consider in this priority order):
308309

309-
- Implement your own `getSecondaryResource` method on your `DependentResource` implementation from scratch.
310-
- Override the `selectManagedSecondaryResource` method, if your `DependentResource` extends `AbstractDependentResource`.
310+
- Override the `targetSecondaryResourceID` method, if your `DependentResource` extends `KubernetesDependentResource`,
311+
where it's very often possible to easily determine the `ResourceID` of the secondary resource. This would probably be
312+
the easiest solution if you're working with Kubernetes resources.
313+
- Override the `selectTargetSecondaryResource` method, if your `DependentResource` extends `AbstractDependentResource`.
311314
This should be relatively simple to override this method to optimize the matching to your needs. You can see an
312315
example of such an implementation in
313316
the [`ExternalWithStateDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/ExternalWithStateDependentResource.java)
314-
class.
315-
- Override the `managedSecondaryResourceID` method, if your `DependentResource` extends `KubernetesDependentResource`,
316-
where it's very often possible to easily determine the `ResourceID` of the secondary resource. This would probably be
317-
the easiest solution if you're working with Kubernetes resources.
317+
class.
318+
- As last resort, you can implement your own `getSecondaryResource` method on your `DependentResource` implementation from scratch.
318319

319320
### Sharing an Event Source Between Dependent Resources
320321

0 commit comments

Comments
 (0)