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
worked with a `Map<String,R>` of resources, where id was always type of String.
16
+
17
+
Mainly because of the need to manage external dependent resources more elegantly
18
+
we introduced a cross-cutting concept: [`ResourceIDMapper`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/ResourceIDMapper.java).
19
+
That gets the ID of a resource. This is used then across various components, see:
We also added [`ResourceIDProvider`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/ResourceIDProvider.java)
27
+
that you can implement into you Pojo representing a resource.
28
+
29
+
The easiest way to migrate to this new approach is to implement this interface for your (external) resource,
30
+
and set the ID type generics for the components above. The default implementation of the `ResourceIDMapper`
31
+
works with `ResourceIDProvider` see [related implementation](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/ResourceIDMapper.java#L52).
32
+
33
+
If you cannot implement `ResourceIDProvider` because for example the class that represents the external resource is generated and final,
34
+
you can always set a custom `ResourceIDMapper` on the components above.
12
35
13
36
See also:
14
37
- related issue: [link](https://github.com/operator-framework/java-operator-sdk/issues/2972)
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/external/PerResourcePollingDependentResource.java
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/external/PollingDependentResource.java
+12-5Lines changed: 12 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -30,17 +30,24 @@ public abstract class PollingDependentResource<R, P extends HasMetadata, ID>
0 commit comments