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/dependent-resources/_index.md
+8-7
Original file line number
Diff line number
Diff line change
@@ -304,17 +304,18 @@ resource matching the desired state associated with the primary resource. This m
304
304
state computation already needs to be able to discriminate among multiple related secondary resources to tell JOSDK how
305
305
they should be reconciled.
306
306
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):
308
309
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`.
311
314
This should be relatively simple to override this method to optimize the matching to your needs. You can see an
312
315
example of such an implementation in
313
316
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.
318
319
319
320
### Sharing an Event Source Between Dependent Resources
0 commit comments