Skip to content

Commit 8850e90

Browse files
committed
docs
Signed-off-by: Attila Mészáros <csviri@gmail.com>
1 parent 6ab1979 commit 8850e90

File tree

2 files changed

+3
-51
lines changed

2 files changed

+3
-51
lines changed

docs/documentation/features.md

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -186,57 +186,6 @@ annotation. If you do not specify a finalizer name, one will be automatically ge
186186

187187
From v5 by default finalizer is added using Served Side Apply. See also UpdateControl in docs.
188188

189-
## Automatic Observed Generation Handling
190-
191-
Having an `.observedGeneration` value on your resources' status is a best practice to
192-
indicate the last generation of the resource which was successfully reconciled by the controller.
193-
This helps users / administrators diagnose potential issues.
194-
195-
In order to have this feature working:
196-
197-
- the **status class** (not the resource itself) must implement the
198-
[`ObservedGenerationAware`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/ObservedGenerationAware.java)
199-
interface. See also
200-
the [`ObservedGenerationAwareStatus`](https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/ObservedGenerationAwareStatus.java)
201-
convenience implementation that you can extend in your own status class implementations.
202-
- The other condition is that the `CustomResource.getStatus()` method should not return `null`.
203-
So the status should be instantiated when the object is returned using the `UpdateControl`.
204-
205-
If these conditions are fulfilled and generation awareness is activated, the observed generation
206-
is automatically set by the framework after the `reconcile` method is called.
207-
208-
When using SSA based patches, the observed generation is only updated when `UpdateControl.patchStatus` or
209-
`UpdateControl.patchResourceAndStatus` is returned. In case the of non-SSA based patches
210-
the observed generation is also updated even when `UpdateControl.noUpdate()` is returned from the
211-
reconciler.
212-
See this feature at work in 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).
213-
See turning off an on the SSA based patching at [`ConfigurationServcice.useSSAToPatchPrimaryResource()`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L385-L385).
214-
215-
```java
216-
public class WebPageStatus extends ObservedGenerationAwareStatus {
217-
// omitted code
218-
}
219-
```
220-
221-
Initializing status automatically on custom resource could be done by overriding the `initStatus` method
222-
of `CustomResource`. However, this is NOT advised, since breaks the status patching if you use:
223-
`UpdateControl.patchStatus`. See
224-
also [javadocs](https://github.com/java-operator-sdk/java-operator-sdk/blob/3994f5ffc1fb000af81aa198abf72a5f75fd3e97/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/UpdateControl.java#L41-L42)
225-
.
226-
227-
```java
228-
@Group("sample.javaoperatorsdk")
229-
@Version("v1")
230-
public class WebPage extends CustomResource<WebPageSpec, WebPageStatus>
231-
implements Namespaced {
232-
233-
@Override
234-
protected WebPageStatus initStatus() {
235-
return new WebPageStatus();
236-
}
237-
}
238-
```
239-
240189
## Generation Awareness and Event Filtering
241190

242191
A best practice when an operator starts up is to reconcile all the associated resources because

docs/documentation/v5-0-migration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ permalink: /docs/v5-0-migration
5757
8. `ConfigurationService.getTerminationTimeoutSeconds` and associated overriding mechanism have been removed,
5858
use `Operator.stop(Duration)` instead.
5959
9. `Operator.installShutdownHook()` has been removed, use `Operator.installShutdownHook(Duration)` instead
60+
10. Automated observed generation handling feature was removed, since it is trivial to do manually and
61+
since it cannot be done automatically in all cases with SSA, having different behavior for SSA and non-SSA
62+
usage would be confusing.

0 commit comments

Comments
 (0)