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
make sure that a reconciliation happens when a custom resource is instructed to be deleted. Typical case when it's
39
39
useful, when an operator is down (pod not running). Without a finalizer the reconciliation - thus the cleanup -
40
-
i.e. [`Cleaner.cleanup(...)`](https://github.com/java-operator-sdk/java-operator-sdk/blob/b82c1f106968cb3eb18835c5e9cd1e4d5c40362e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java#L28-L28)
40
+
i.e. [`Cleaner.cleanup(...)`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java#L28)
41
41
would not happen if a custom resource is deleted.
42
42
43
-
To use finalizers the reconciler have to implement [`Cleaner<P>`](https://github.com/java-operator-sdk/java-operator-sdk/blob/b82c1f106968cb3eb18835c5e9cd1e4d5c40362e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java) interface.
44
-
In other words, finalizer is added if the `Reconciler` implements `Cleaner` interface. If not, no
43
+
To use finalizers the reconciler have to implement [`Cleaner<P>`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java) interface.
44
+
In other words, finalizer is added only if the `Reconciler` implements `Cleaner` interface. If not, no
45
45
finalizer is added and/or removed.
46
46
47
47
Finalizers are automatically added by the framework as the first step, thus after a custom resource is created, but
@@ -69,7 +69,7 @@ When automatic finalizer handling is turned off, the `Reconciler.cleanup(...)` m
69
69
case when a delete event received. So it does not make sense to implement this method and turn off finalizer at the same
70
70
time.
71
71
72
-
## The `reconcile` and [`cleanup`](https://github.com/java-operator-sdk/java-operator-sdk/blob/b82c1f106968cb3eb18835c5e9cd1e4d5c40362e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java) Methods on a [`Reconciler`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java)
72
+
## The [`reconcile`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java#L16) and [`cleanup`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java#L28)
73
73
74
74
The lifecycle of a custom resource can be clearly separated into two phases from the perspective of an operator. When a
75
75
custom resource is created or update, or on the other hand when the custom resource is deleted - or rather marked for
@@ -160,7 +160,7 @@ In order to have this feature working:
160
160
If these conditions are fulfilled and generation awareness not turned off, the observed generation is automatically set
161
161
by the framework after the `reconcile` method is called. Note that the observed generation is updated also
162
162
when `UpdateControl.noUpdate()` is returned from the reconciler. See this feature working in
163
-
the [WebPage example](https://github.com/java-operator-sdk/java-operator-sdk/blob/b91221bb54af19761a617bf18eef381e8ceb3b4c/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStatus.java#L5)
163
+
the [WebPage example](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStatus.java#L5)
164
164
.
165
165
166
166
```java
@@ -361,7 +361,7 @@ of requests to Kubernetes API server, and leads to faster reconciliation cycles.
361
361
Note that when an operator starts and the first reconciliation is executed the caches are already populated for example
362
362
for `InformerEventSource`.Currently, this is not true however for `PerResourceEventSource`, where the cache might or
363
363
might not be populated. To handle this situation elegantly methods are provided which checks the object in cache, if
364
-
not found tries to get it from the supplier. See related [method](https://github.com/java-operator-sdk/java-operator-sdk/blob/e7fd79968a238d7e0acc446d949b83a06cea17b5/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/polling/PerResourcePollingEventSource.java#L145)
364
+
not found tries to get it from the supplier. See related [method](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/polling/PerResourcePollingEventSource.java#L146)
0 commit comments