Skip to content

Commit 44371de

Browse files
committed
changes for CR
1 parent ec54968 commit 44371de

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

operator-framework/src/test/java/io/javaoperatorsdk/operator/PrimaryToSecondaryDependentIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void testPrimaryToSecondaryInDependentResources() {
4343
});
4444

4545
cm.setData(Map.of(DATA_KEY, TEST_DATA));
46-
operator.replace(cm);
4746
var executions = reconciler.getNumberOfExecutions();
47+
operator.replace(cm);
4848

4949
await().pollDelay(Duration.ofMillis(250)).untilAsserted(() -> {
5050
assertThat(reconciler.getNumberOfExecutions()).isGreaterThan(executions);

operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/primarytosecondaydependent/PrimaryToSecondaryDependentReconciler.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public int getNumberOfExecutions() {
5252
return numberOfExecutions.get();
5353
}
5454

55+
/**
56+
* Here just simply creating an Event Source, and setting it for the Dependent Resource. Since it
57+
* is not possible to do this setup within the bounds of the KubernetesDependentResource API.
58+
* However, this is quite a corner case; might be covered more out of the box in the future if
59+
* there will be demand for it.
60+
**/
5561
@Override
5662
public Map<String, EventSource> prepareEventSources(
5763
EventSourceContext<PrimaryToSecondaryDependentCustomResource> context) {
@@ -73,7 +79,7 @@ public Map<String, EventSource> prepareEventSources(
7379
return Map.of(CONFIG_MAP_EVENT_SOURCE, cmES);
7480
}
7581

76-
private String indexKey(String clusterName, String namespace) {
77-
return clusterName + "#" + namespace;
82+
private String indexKey(String configMapName, String namespace) {
83+
return configMapName + "#" + namespace;
7884
}
7985
}

0 commit comments

Comments
 (0)