import "github.com/k-orc/openstack-resource-controller/v2/internal/controllers/generic/progress"- type ReconcileStatus
- func NeedsRefresh() ReconcileStatus
- func NewReconcileStatus() ReconcileStatus
- func WaitingOnFinalizer(finalizer string) ReconcileStatus
- func WaitingOnObject(kind, name string, waitingOn WaitingOnEvent) ReconcileStatus
- func WaitingOnOpenStack(waitingOn WaitingOnEvent, pollingPeriod time.Duration) ReconcileStatus
- func WrapError(err error) ReconcileStatus
- func (r ReconcileStatus) GetError() error
- func (r ReconcileStatus) GetProgressMessages() []string
- func (r ReconcileStatus) GetRequeue() time.Duration
- func (r ReconcileStatus) NeedsRefresh() ReconcileStatus
- func (r ReconcileStatus) NeedsReschedule() (bool, error)
- func (r ReconcileStatus) Return(log logr.Logger) (ctrl.Result, error)
- func (r ReconcileStatus) WaitingOnFinalizer(finalizer string) ReconcileStatus
- func (r ReconcileStatus) WaitingOnObject(kind, name string, waitingOn WaitingOnEvent) ReconcileStatus
- func (r ReconcileStatus) WaitingOnOpenStack(waitingOn WaitingOnEvent, pollingPeriod time.Duration) ReconcileStatus
- func (r ReconcileStatus) WithError(err error) ReconcileStatus
- func (r ReconcileStatus) WithProgressMessage(msgs ...string) ReconcileStatus
- func (r ReconcileStatus) WithReconcileStatus(o ReconcileStatus) ReconcileStatus
- func (r ReconcileStatus) WithRequeue(requeue time.Duration) ReconcileStatus
- type WaitingOnEvent
type ReconcileStatus
ReconcileStatus represents the status of the current reconcile.
nil is a valid ReconcileStatus. It is safe to call all methods on a nil ReconcileStatus.
You MUST use the return value of any method which returns ReconcileStatus: the returned object may not be equal to the receiver, for example when the receiver is nil.
type ReconcileStatus = *reconcileStatusfunc NeedsRefresh
func NeedsRefresh() ReconcileStatusNeedsRefresh is a convenience method which returns a new ReconcileStatus with NeedsRefresh.
func NewReconcileStatus
func NewReconcileStatus() ReconcileStatusNewReconcileStatus returns an empty ReconcileStatus
func WaitingOnFinalizer
func WaitingOnFinalizer(finalizer string) ReconcileStatusWaitingOnFinalizer is a convenience method which returns a new ReconcileStatus with WaitingOnFinalizer.
func WaitingOnObject
func WaitingOnObject(kind, name string, waitingOn WaitingOnEvent) ReconcileStatusWaitingOnObject is a convenience method which returns a new ReconcileStatus with WaitingOnObject.
func WaitingOnOpenStack
func WaitingOnOpenStack(waitingOn WaitingOnEvent, pollingPeriod time.Duration) ReconcileStatusWaitingOnOpenStack is a convenience method which returns a new ReconcileStatus with WaitingOnOpenStack.
func WrapError
func WrapError(err error) ReconcileStatusWrapError returns a ReconcileStatus containing the given error
func (ReconcileStatus) GetError
func (r ReconcileStatus) GetError() errorGetError returns an error representing all errors which have been added to this ReconcileStatus. If multiple errors have been added they will have been combined with errors.Join()
func (ReconcileStatus) GetProgressMessages
func (r ReconcileStatus) GetProgressMessages() []stringGetProgressMessages returns all progress messages which have been added to this ReconcileStatus
func (ReconcileStatus) GetRequeue
func (r ReconcileStatus) GetRequeue() time.DurationGetRequeue returns the time after which the current object should be reconciled again. A value of 0 indicates that no requeue is requested.
func (ReconcileStatus) NeedsRefresh
func (r ReconcileStatus) NeedsRefresh() ReconcileStatusNeedsRefresh indicates that the resource status needs to be refreshed. It sets an appropriate progress message and ensures that the object will be reconciled again immediately.
func (ReconcileStatus) NeedsReschedule
func (r ReconcileStatus) NeedsReschedule() (bool, error)NeedsReschedule returns a boolean value indicating whether the ReconcileStatus will set the Progressing condition to true, and therefore that we intend to be scheduled again. It additionally returns any error associated with the ReconcileStatus.
NeedsReschedule is used to shortcut reconciliation if any precondition has not been met.
func (ReconcileStatus) Return
func (r ReconcileStatus) Return(log logr.Logger) (ctrl.Result, error)Return returns the the (ctrl.Result, error) expected by controller-runtime for a ReconcileStatus.
If a ReconcileStatus contains a TerminalError, Return will log the error directly instead of returning it to controller-runtime, as this would cause an undesirable reschedule.
func (ReconcileStatus) WaitingOnFinalizer
func (r ReconcileStatus) WaitingOnFinalizer(finalizer string) ReconcileStatusWaitingOnFinalizer adds a progress message indicating that we are waiting for a specific finalizer to be removed.
func (ReconcileStatus) WaitingOnObject
func (r ReconcileStatus) WaitingOnObject(kind, name string, waitingOn WaitingOnEvent) ReconcileStatusWaitingOnObject adds a progress message indicating that we are waiting on a kubernetes object of type kind with name. We expect the controller to have an appropriate watch and handler for this event, so WaitingOnObject does not add an explicit requeue.
func (ReconcileStatus) WaitingOnOpenStack
func (r ReconcileStatus) WaitingOnOpenStack(waitingOn WaitingOnEvent, pollingPeriod time.Duration) ReconcileStatusWaitingOnOpenStack indicates that we are waiting for an event on the current OpenStack resource. It adds an appropriate progress message. It also adds a requeue with the requested polling period, as we are not able to receive triggers for OpenStack events.
func (ReconcileStatus) WithError
func (r ReconcileStatus) WithError(err error) ReconcileStatusWithError returns a ReconcileStatus containing the given error joined to any existing errors.
func (ReconcileStatus) WithProgressMessage
func (r ReconcileStatus) WithProgressMessage(msgs ...string) ReconcileStatusWithProgressMessage returns a ReconcileStatus with the given progress messages in addition to any already present.
func (ReconcileStatus) WithReconcileStatus
func (r ReconcileStatus) WithReconcileStatus(o ReconcileStatus) ReconcileStatusWithReconcileStatus returns a ReconcileStatus combining all properties of the given ReconcileStatus.
func (ReconcileStatus) WithRequeue
func (r ReconcileStatus) WithRequeue(requeue time.Duration) ReconcileStatusWithRequeue returns a ReconcileStatus with a request to requeue after the given time. If the ReconcileStatus already requests a requeue, the returned object will have the lesser of the existing and requested requeues.
type WaitingOnEvent
WaitingOnEvent represents the type of event we are waiting on
type WaitingOnEvent intconst (
// WaitingOnCreation indicates waiting for an object to be created
WaitingOnCreation WaitingOnEvent = iota
// WaitingOnReady indicates that an object exists but is not yet in the necessary state
WaitingOnReady
// WaitingOnDeletion indicates waiting for an object to be deleted
WaitingOnDeletion
)Generated by gomarkdoc