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/access-resources.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Such capabilities are:
34
34
The question is, how to trigger reconciliation of a primary resources (your custom resource),
35
35
when Informer receives a new resource.
36
36
For this purpose the framework uses [`SecondaryToPrimaryMapper`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/SecondaryToPrimaryMapper.java)
37
-
that tells (mostly) based on the resource which primary resource reconciliation to trigger.
37
+
that tells (usually) based on the resource which primary resource reconciliation to trigger.
38
38
The mapping is usually done based on the owner reference or annotation on the secondary resource.
39
39
(But not always, as we will see)
40
40
@@ -94,16 +94,17 @@ public class WebPageReconciler implements Reconciler<WebPage> {
94
94
95
95
## The Use Case for PrimaryToSecondaryMapper
96
96
97
-
As we discussed, we provide an unified API to access related resources using `Context.getSecondaryResources(...)`.
97
+
As we discussed, we provide a unified API to access related resources using `Context.getSecondaryResources(...)`.
98
98
This method was on purpose uses `Secondary` resource, since those are not only child resources - how
99
99
resources that are created by the reconciler are sometimes called in Kubernetes world - and usually have owner references for the custom resources;
100
-
neither related resources which are usually resources that serves as input for the primary (not managed). It is the union of both.
100
+
neither related resources which are usually resources that serves as input for the primary (not managed).
101
+
It is the union of both.
101
102
102
103
The issue is if we want to trigger reconciliation for a resource, that does not have an owner reference or other direct
103
104
association with the primary resource.
104
105
Typically, if you have ConfigMap where you have input parameters for a set of primary resources,
105
-
and the primary is actually referencing the secondary resource. Like having the name of the ConfigMap in the spec part
106
-
of the primary resource.
106
+
and the primary is actually referencing the secondary resource.
107
+
In other words, having the name of the ConfigMap in the spec part of the primary resource.
107
108
108
109
As an example we provide, have a primary resource a `Job` that references a `Cluster` resource.
109
110
So multiple `Job` can reference the same `Cluster`, and we want to trigger `Job` reconciliation if cluster changes.
0 commit comments