Documentation ¶
Overview ¶
Package update defines the Status type, which classifies the result of a synchronization operation by the controller. This distinguishes forms of success or failure after an Add/Update/Delete notification for the resource types that the controller watches, and determeins furher actions such as error handling, logging and event generation.
Index ¶
- type Status
- func Make(t StatusType, format string, args ...interface{}) Status
- func MakeFatal(format string, args ...interface{}) Status
- func MakeIncomplete(format string, args ...interface{}) Status
- func MakeNoop(format string, args ...interface{}) Status
- func MakeRecoverable(format string, args ...interface{}) Status
- func MakeSuccess(format string, args ...interface{}) Status
- type StatusType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Status ¶
type Status struct { Msg string Type StatusType }
Status encapsulates the result of a synchronization operation, including its type and an optional detail message (an error message for the error types).
func Make ¶
func Make(t StatusType, format string, args ...interface{}) Status
Make is a convenience function to create a Status of the given type, setting the Msg to a formatted string.
func MakeFatal ¶
MakeFatal creates a Fatal Status with a formatted string for the Msg.
func MakeIncomplete ¶
MakeIncomplete creates an Incomplete Status with a formatted string for the Msg.
func MakeNoop ¶
MakeNoop creates a Noop Status with a formatted string for the Msg.
func MakeRecoverable ¶
MakeRecoverable creates a Recoverable Status with a formatted string for the Msg.
func MakeSuccess ¶
MakeSuccess creates a Success Status with a formatted string for the Msg.
func (Status) IsError ¶
IsError returns true iff the Status has one of the error types: Fatal, Recoverable or Incomplete.
func (Status) Reason ¶
Reason returns a string suitable as the reason string for an event after a sync returns. Identical to Reason() for the given type.
type StatusType ¶
type StatusType uint8
StatusType is the classifier for the result of a synchronization.
const ( // Noop indicates that no change in the cluster was // necessary. The result is logged, but no further action is // taken. Noop StatusType = iota // Success indicates that a change in the cluster was // successfully executed. The result is logged, and an event // is generated for the resource that was synchronized. Success // Fatal indicates an unrecoverable error, which cannot be // compensated by retrying the same synchronization. For // example, an invalid configuration is unrecoverable, if it // can never become valid until it is changed. This result is // logged, a warning event is generated, and the operation is // never retried. Fatal // Recoverable indicates an error that might be compensated // with a retry. For example, network errors in the cluster // such as a timeouts may be temporary, and hence may succeed // on retry. This result is logged, a warning event is // generated, and the sync operation is re-queued with a rate // limiting delay (likely an exponential backoff, as scheduled // by the client-go workqueue). Recoverable // Incomplete indicates that a cluster change is necessary, // but the controller does not currently have all of the // information that it requires. For example, a Service // configuration may have been added, but the Endpoints are // not yet known (the Service's Pods might still be starting // up). This result is logged, a warning event is generated, // and the sync operation is scheduled for retry after a brief // delay (default 5s), since the missing info commonly becomes // available within a brief time. Incomplete )
func (StatusType) Reason ¶
func (t StatusType) Reason() string
Reason returns a string suitable as the reason string for an event after a sync returns the given status type.
Success: SyncSuccess Fatal: SyncFatalError Recoverable: SyncRecoverableError Incomplete: SyncIncomplete
Not valid for the Noop type, since no event is generated for Noop.
func (StatusType) String ¶
func (t StatusType) String() string