Skip to content

Commit fcca8e6

Browse files
authored
Update v5-release.md
1 parent 43c8013 commit fcca8e6

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

docsy/content/en/blog/releases/v5-release.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ This interface also implemented some utility methods, which can now be found in
5757
### Removal of ErrorStatusHandler interface
5858

5959
Similarly to `EventSourceInitializer` the `ErrorStatusHandler` interface is removed; now the `Reconciler` interface has a default method `updateErrorStatus`,
60-
you can just delete the interface from your `Reconciler`:
60+
you can delete the interface from your `Reconciler`:
6161

6262
```java
63-
6463
public class WebPageReconciler
6564
implements Reconciler<WebPage>, E̶r̶r̶o̶r̶S̶t̶a̶t̶u̶s̶H̶a̶n̶d̶l̶e̶r̶<W̶e̶b̶P̶a̶g̶e̶> {
6665

@@ -73,10 +72,37 @@ See [related issue](https://github.com/operator-framework/java-operator-sdk/issu
7372

7473
### Named event sources
7574

76-
The name is now directly an attribute of an `EventSource.` EventSources were also named in previous releases, but the name was not an attribute. This leads mainly to better internal structures and
77-
solves issues out of the box. For example, when a dependent resource provides an event source, in some cases, it needs to have a specific name.
75+
The name is now directly an attribute of an `EventSource`. EventSources were also named in previous releases, but the name was not an attribute. This leads mainly to better internal structures and
76+
solves issues out of the box. For example, when a dependent resource provides an event source, in some cases, it needs to have a specific name. In a `Reconciler` implementation simply
77+
use a `List.of(event sources)` instead the `Map<String,EventSource>` as it was before:
78+
79+
80+
```java
81+
82+
public class WebPageReconciler
83+
implements Reconciler<WebPage> {
84+
85+
// omitted code
86+
87+
@Override
88+
public List<EventSource> prepareEventSources(EventSourceContext<WebPage> context) {
89+
var configMapEventSource =
90+
new InformerEventSource<>(InformerConfiguration.from(ConfigMap.class, context)
91+
.withLabelSelector(SELECTOR)
92+
.build(), context);
93+
var deploymentEventSource = ... // code omitted
94+
95+
return List.of(configMapEventSource, deploymentEventSource);
96+
}
97+
98+
}
99+
```
100+
101+
There is a new utility class [EventSourceUtils](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/EventSourceUtils.java#L10-L10) to help extract event source from workflows and
102+
dependent resources.
103+
104+
78105

79-
TODO
80106

81107

82108

0 commit comments

Comments
 (0)