errors

package
v1.9.0-p01 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNoRequeueError

func IsNoRequeueError(err error) bool

IsNoRequeueError returns true if the error or a nested error is a NoRequeueError.

func IsNoRequeueNoError

func IsNoRequeueNoError(err error) bool

IsNoRequeueNoError returns true if the error or a nested error is a NoRequeueError with DoNotErr=true.

func NoRequeueNoErr

func NoRequeueNoErr(msg string) error

NoRequeueNoErr returns a NoRequeueErr with DoNotErr=true.

func ResultFromError

func ResultFromError(err error) (ctrl.Result, error)

ResultFromError returns a ReconcileResult based on the provided error. If the error contains an embedded RequeueError or NoRequeueError, then it is used to influence the result. An embedded RequeueError is favored in an error that also contains a NoRequeueError. An embedded NoRequeueError will return a controller-runtime TerminalError that will be logged and counted as an error but does not retry.

func WatchVMICacheIfNotReady

func WatchVMICacheIfNotReady(err error, obj metav1.Object) bool

WatchVMICacheIfNotReady checks if the provided error contains an ErrVMICacheNotReady error. If so, a label, and optionally two annotations, are added to the provided object that allow it to be reconciled when the VMI Cache object is updated. This function returns true if the specified error contains an ErrVMICacheNotReady error, otherwise false is returned.

Types

type NoRequeueError

type NoRequeueError struct {
	Message string

	// DoNotErr may be set to true in order to prevent a reconciler from
	// returning a TerminalError. This is helpful when the error is intended to
	// stop the reconciliation loop, but not intended to be logged as an error.
	DoNotErr bool
}

NoRequeueError may be returned from any part of a reconcile call stack and the controller will not requeue the request. This can be used to return an error but not cause the back-off retry to occur.

func (NoRequeueError) Error

func (e NoRequeueError) Error() string

type RequeueError

type RequeueError struct {
	After time.Duration
}

RequeueError may be returned from any part of a reconcile call stack and the controller should requeue the request. If After > 0 then the request is requeued with the provided value, otherwise the request is requeued immediately.

func (RequeueError) Error

func (e RequeueError) Error() string

type VMICacheNotReadyError

type VMICacheNotReadyError struct {
	// Message is returned by the Error function. If empty, the Error function
	// returns "cache not ready".
	Message string

	// Name of the VirtualMachineImageCache object.
	Name string

	// DatacenterID describes the ID of the datacenter that does not have the
	// cached disks.
	// This field is only non-empty when the error is returned when waiting on
	// disks to be cached.
	DatacenterID string

	// DatastoreID describes the ID of the datastore that does not have the
	// cached disks.
	// This field is only non-empty when the error is returned when waiting on
	// disks to be cached.
	DatastoreID string
}

VMICacheNotReadyError is returned from a method that cannot proceed until a VirtualMachineImageCache object is not ready.

func (VMICacheNotReadyError) Error

func (e VMICacheNotReadyError) Error() string

Jump to

Keyboard shortcuts

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