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
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,6 +164,7 @@ You can then `Build()` the status updater and run `UpdateStatus()` to do the act
164
164
- By using `WithSmartRequeue`, the [smart requeuing logic](./smartrequeue.md) can be used.
165
165
- A `smartrequeue.Store` is required to be configured outside of the status updater, because it has to be persisted across multiple reconciliations.
166
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.
167
+
- The `WithSmartRequeue` function takes `SmartRequeueConditional`s as optional arguments, which are basically functions that take the `ReconcileResult` and return a smart requeue value (see below). This is especially useful to set the requeue depending on the object's new conditions, which would otherwise be difficult, because the conditions have not yet been updated before `UpdateStatus` is called and the requeue time has already been determined when `UpdateStatus` returns.
// - "Backoff": the object is requeued with an increasing backoff, as specified in the store.
136
137
// - "Reset": the object is requeued, but the backoff is reset to its minimal value, as specified in the store.
137
138
// - "NoRequeue": the object is not requeued.
139
+
//
140
+
// If any SmartRequeueConditionals are passed in, they will be evaluated in order and can override the action set in the ReconcileResult.
141
+
// As determining the requeue time is the last thing that happens in the status updater, these functions can be used react to the final status of the reconciled object, which might not be known earlier in the reconciliation
142
+
// (e.g. because the conditions were only updated in the status updater).
143
+
//
138
144
// 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
145
// 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
146
// 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