Skip to content

Commit ffc9e85

Browse files
committed
wip
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent cef1edd commit ffc9e85

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,15 @@ they should be reconciled.
303303
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),
304304
it is always possible to override this automated discrimination using several means (consider in this priority order):
305305

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`,
307308
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
310+
[`targetSecondaryResourceID`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/AbstractExternalDependentResource.java#L138)
311+
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).
314315
- As last resort, you can implement your own `getSecondaryResource` method on your `DependentResource` implementation from scratch.
315316

316317
### Sharing an Event Source Between Dependent Resources

0 commit comments

Comments
 (0)