Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SyncObjectWithCluster ¶
SyncObjectWithCluster synchronises the state of specObj to the cluster, creating or updating the cluster object as required. If specObj is in sync with the cluster, returns the object as it exists on the cluster. Returns a NotInSyncError if an update is required, UnrecoverableSyncError if object provided is invalid, or generic error if an unexpected error is encountered
Types ¶
type ClusterAPI ¶
type NotInSyncError ¶
type NotInSyncError struct { Reason NotInSyncReason Object crclient.Object }
NotInSyncError is returned when a spec object is out-of-sync with its cluster counterpart
func NewNotInSync ¶
func NewNotInSync(obj crclient.Object, reason NotInSyncReason) *NotInSyncError
NewNotInSync wraps creation of NotInSyncErrors for simplicity
func (*NotInSyncError) Error ¶
func (e *NotInSyncError) Error() string
type NotInSyncReason ¶
type NotInSyncReason string
const ( UpdatedObjectReason NotInSyncReason = "Updated object" CreatedObjectReason NotInSyncReason = "Created object" DeletedObjectReason NotInSyncReason = "Deleted object" NeedRetryReason NotInSyncReason = "Need to retry" )
type UnrecoverableSyncError ¶
type UnrecoverableSyncError struct {
Cause error
}
UnrecoverableSyncError is returned when provided objects cannot be synced with the cluster due to an unexpected error (e.g. they are invalid according to the object's spec).
func (*UnrecoverableSyncError) Error ¶
func (e *UnrecoverableSyncError) Error() string