progress

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReconcileStatus added in v2.1.0

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 NeedsRefresh

func NeedsRefresh() ReconcileStatus

NeedsRefresh is a convenience method which returns a new ReconcileStatus with NeedsRefresh.

func NewReconcileStatus added in v2.1.0

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 added in v2.1.0

func WaitingOnObject(kind, name string, waitingOn WaitingOnEvent) ReconcileStatus

WaitingOnObject is a convenience method which returns a new ReconcileStatus with WaitingOnObject.

func WaitingOnOpenStack added in v2.1.0

func WaitingOnOpenStack(waitingOn WaitingOnEvent, pollingPeriod time.Duration) ReconcileStatus

WaitingOnOpenStack is a convenience method which returns a new ReconcileStatus with WaitingOnOpenStack.

func WrapError added in v2.1.0

func WrapError(err error) ReconcileStatus

WrapError returns a ReconcileStatus containing the given error

func (ReconcileStatus) GetError added in v2.1.0

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 added in v2.1.0

func (r ReconcileStatus) GetProgressMessages() []string

GetProgressMessages returns all progress messages which have been added to this ReconcileStatus

func (ReconcileStatus) GetRequeue added in v2.1.0

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) NeedsRefresh added in v2.1.0

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 added in v2.1.0

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 added in v2.1.0

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 added in v2.1.0

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 added in v2.1.0

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 added in v2.1.0

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 added in v2.1.0

func (r ReconcileStatus) WithError(err error) ReconcileStatus

WithError returns a ReconcileStatus containing the given error joined to any existing errors.

func (ReconcileStatus) WithProgressMessage added in v2.1.0

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 added in v2.1.0

func (r ReconcileStatus) WithReconcileStatus(o ReconcileStatus) ReconcileStatus

WithReconcileStatus returns a ReconcileStatus combining all properties of the given ReconcileStatus.

func (ReconcileStatus) WithRequeue added in v2.1.0

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 added in v2.1.0

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL