Documentation
¶
Index ¶
- type ReconcileStatus
- func ExternallyDeleted() 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) ExternallyDeleted() ReconcileStatus
- func (r ReconcileStatus) GetError() error
- func (r ReconcileStatus) GetProgressMessages() []string
- func (r ReconcileStatus) GetRequeue() time.Duration
- func (r ReconcileStatus) IsExternallyDeleted() bool
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReconcileStatus ¶
type ReconcileStatus = *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.
func ExternallyDeleted ¶
func ExternallyDeleted() ReconcileStatus
ExternallyDeleted is a convenience method which returns a new ReconcileStatus with ExternallyDeleted.
func NeedsRefresh ¶
func NeedsRefresh() ReconcileStatus
NeedsRefresh is a convenience method which returns a new ReconcileStatus with NeedsRefresh.
func NewReconcileStatus ¶
func NewReconcileStatus() ReconcileStatus
NewReconcileStatus returns an empty ReconcileStatus
func WaitingOnFinalizer ¶
func WaitingOnFinalizer(finalizer string) ReconcileStatus
WaitingOnFinalizer is a convenience method which returns a new ReconcileStatus with WaitingOnFinalizer.
func WaitingOnObject ¶
func WaitingOnObject(kind, name string, waitingOn WaitingOnEvent) ReconcileStatus
WaitingOnObject is a convenience method which returns a new ReconcileStatus with WaitingOnObject.
func WaitingOnOpenStack ¶
func WaitingOnOpenStack(waitingOn WaitingOnEvent, pollingPeriod time.Duration) ReconcileStatus
WaitingOnOpenStack is a convenience method which returns a new ReconcileStatus with WaitingOnOpenStack.
func WrapError ¶
func WrapError(err error) ReconcileStatus
WrapError returns a ReconcileStatus containing the given error
func (ReconcileStatus) ExternallyDeleted ¶
func (r ReconcileStatus) ExternallyDeleted() ReconcileStatus
ExternallyDeleted returns a ReconcileStatus indicating that the OpenStack resource referenced by status.id has been deleted outside of ORC. The caller is expected to clear status.id and add an appropriate progress message.
func (ReconcileStatus) GetError ¶
func (r ReconcileStatus) GetError() error
GetError 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() []string
GetProgressMessages returns all progress messages which have been added to this ReconcileStatus
func (ReconcileStatus) GetRequeue ¶
func (r ReconcileStatus) GetRequeue() time.Duration
GetRequeue returns the time after which the current object should be reconciled again. A value of 0 indicates that no requeue is requested.
func (ReconcileStatus) IsExternallyDeleted ¶
func (r ReconcileStatus) IsExternallyDeleted() bool
IsExternallyDeleted returns true if the ReconcileStatus indicates that the OpenStack resource was deleted externally.
func (ReconcileStatus) NeedsRefresh ¶
func (r ReconcileStatus) NeedsRefresh() ReconcileStatus
NeedsRefresh 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 ¶
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) ReconcileStatus
WaitingOnFinalizer 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) ReconcileStatus
WaitingOnObject 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) ReconcileStatus
WaitingOnOpenStack 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) ReconcileStatus
WithError returns a ReconcileStatus containing the given error joined to any existing errors.
func (ReconcileStatus) WithProgressMessage ¶
func (r ReconcileStatus) WithProgressMessage(msgs ...string) ReconcileStatus
WithProgressMessage returns a ReconcileStatus with the given progress messages in addition to any already present.
func (ReconcileStatus) WithReconcileStatus ¶
func (r ReconcileStatus) WithReconcileStatus(o ReconcileStatus) ReconcileStatus
WithReconcileStatus returns a ReconcileStatus combining all properties of the given ReconcileStatus.
func (ReconcileStatus) WithRequeue ¶
func (r ReconcileStatus) WithRequeue(requeue time.Duration) ReconcileStatus
WithRequeue 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 ¶
type WaitingOnEvent int
WaitingOnEvent represents the type of event we are waiting on
const ( // 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 )