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
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).
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)
0 commit comments