Skip to content

Commit 099191a

Browse files
authored
docs: add faq entry regarding event filtering (#2842)
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 1a01e50 commit 099191a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/content/en/docs/faq/_index.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,32 @@ to make sure an updated status is present for the next reconciliation.
9595

9696
Dependent Resources feature supports the [first approach](../documentation/dependent-resource-and-workflows/dependent-resources.md#external-state-tracking-dependent-resources).
9797

98+
### How can I make the status update of my custom resource trigger a reconciliation?
99+
100+
For the primary resource, the framework by default specially checks if the change on the primary
101+
resource is increased the `generation` field in the metadata, and filters out the related event if not.
102+
This field is increased when `.spec` of the resource is changed. Therefore, a change in the `.status` field
103+
will not trigger a reconciliation.
104+
105+
To change this behavior, you can set the [`generationAwareEventProcessing`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java#L43)
106+
to `false`:
107+
108+
```java
109+
@ControllerConfiguration(generationAwareEventProcessing = false)
110+
static class TestCustomReconciler implements Reconciler<TestCustomResource> {
111+
112+
@Override
113+
public UpdateControl<TestCustomResource> reconcile(TestCustomResource resource, Context<TestCustomResource> context) {
114+
// code omitted
115+
}
116+
}
117+
```
118+
119+
For secondary resources, every change should trigger a reconciliation by default.
120+
Except when you add explicit filter or use dependent resources that by default filter out own changes,
121+
see [related docs](../documentation/dependent-resource-and-workflows/dependent-resources.md#caching-and-event-handling-in-kubernetesdependentresource).
122+
123+
98124
### How can I skip the reconciliation of a dependent resource?
99125

100126
Skipping workflow reconciliation altogether is possible with the explicit invocation feature since v5.

0 commit comments

Comments
 (0)