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/documentation/dependent-resource-and-workflows/dependent-resources.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -303,14 +303,15 @@ they should be reconciled.
303
303
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),
304
304
it is always possible to override this automated discrimination using several means (consider in this priority order):
305
305
306
-
- Override the `targetSecondaryResourceID` method, if your `DependentResource` extends `KubernetesDependentResource`,
306
+
- Override the [`targetSecondaryResourceID`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L282)
307
+
method, if your `DependentResource` extends `KubernetesDependentResource`,
307
308
where it's very often possible to easily determine the `ResourceID` of the secondary resource. This would probably be
308
-
the easiest solution if you're working with Kubernetes resources.
309
-
- Override the `selectTargetSecondaryResource` method, if your `DependentResource` extends `AbstractDependentResource`.
310
-
This should be relatively simple to override this method to optimize the matching to your needs. You can see an
311
-
example of such an implementation in
312
-
the [`ExternalWithStateDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/dependent/externalstate/ExternalWithStateDependentResource.java)
313
-
class.
309
+
the easiest solution if you're working with Kubernetes resources. Similarly, for you can override the
for external resources. See below the related ID handling
312
+
- If the approach from above doesn't fit your needs, you can override the target resource selection mechanism by overriding
313
+
`selectTargetSecondaryResource` for both [`KubernetesDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L282)
314
+
and [`AbstractExternalDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/AbstractExternalDependentResource.java#L148).
314
315
- As last resort, you can implement your own `getSecondaryResource` method on your `DependentResource` implementation from scratch.
315
316
316
317
### Sharing an Event Source Between Dependent Resources
0 commit comments