Skip to content

Commit 8166701

Browse files
authored
docs: init status warning (#1552)
1 parent 4936af3 commit 8166701

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/documentation/features.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ public class WebPageStatus extends ObservedGenerationAwareStatus {
199199
}
200200
```
201201

202-
Initializing status on custom resource:
202+
Initializing status automatically on custom resource could be done by overriding the `initStatus` method
203+
of `CustomResource`. However, this is NOT advised, since breaks the status patching if you use:
204+
`UpdateControl.patchStatus`. See
205+
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)
206+
.
203207

204208
```java
205209
@Group("sample.javaoperatorsdk")
@@ -641,8 +645,8 @@ public static void main(String[]args)throws IOException{
641645
KubernetesClient client=new DefaultKubernetesClient();
642646
Operator operator=new Operator(client);
643647
RegisteredController registeredController=operator.register(new WebPageReconciler(client));
644-
operator.installShutdownHook();
645-
operator.start();
648+
operator.installShutdownHook();
649+
operator.start();
646650

647651
// call registeredController further while operator is running
648652
}

0 commit comments

Comments
 (0)