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
Copy file name to clipboardExpand all lines: docs/libs/status.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,9 @@ You can then `Build()` the status updater and run `UpdateStatus()` to do the act
161
161
- The `AllStatusFields()` function returns a list containing all status field keys, _except the one for the status field itself_, for convenience.
162
162
- The `WithCustomUpdateFunc` method can be used to inject a function that performs custom logic on the resource's status. Note that while the function gets the complete object as an argument, only changes to its status will be updated by the status updater.
163
163
-`WithConditionEvents` can be used to enable event recording for changed conditions. The events are automatically connected to the resource from the `ReconcileResult`'s `Object` field, no events will be recorded if that field is `nil`.
164
+
- By using `WithSmartRequeue`, the [smart requeuing logic](./smartrequeue.md) can be used.
165
+
- A `smartrequeue.Store` is required to be configured outside of the status updater, because it has to be persisted across multiple reconciliations.
166
+
- It is also possible to use the smart requeue logic explicitly and modify the `ReconcileResult`'s `Result` field with the returned value, but the integration should be easier to use, since both, the smart requeue logic as well as the status updater, return a `reconcile.Result` and an `error`, which are intended to be directly used as return values for the `Reconcile` method.
// WithSmartRequeue integrates the smart requeue logic into the status updater.
133
+
// Requires a smartrequeue.Store to be passed in (this needs to be persistent across multiple reconciliations and therefore cannot be stored in the status updater itself).
134
+
// The action determines when the object should be requeued:
135
+
// - "Backoff": the object is requeued with an increasing backoff, as specified in the store.
136
+
// - "Reset": the object is requeued, but the backoff is reset to its minimal value, as specified in the store.
137
+
// - "NoRequeue": the object is not requeued.
138
+
// If the 'Result' field in the ReconcileResult has a non-zero RequeueAfter value set, that one is used if it is earlier than the one from smart requeue or if "NoRequeue" has been specified.
139
+
// This function only has an effect if the Object in the ReconcileResult is not nil, the smart requeue store is not nil, and the action is one of the known values.
140
+
// Also, if a reconciliation error occurred, the requeue interval will be reset, but no requeueAfter duration will be set, because controller-runtime will take care of requeuing the object anyway.
0 commit comments