Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retriable ¶
Retriable identifies Kubernetes apiserver errors that are normally transient and safely retriable.
func RetriableOrConflict ¶
RetriableOrConflict identifies Kubernetes apiserver errors that are either retriable or a conflict (retriable with GET + mutation).
func Status ¶
Status attempts to update an object's status, once.
- If the update errors due to a UID conflict, that means the object has been deleted and re-created. So an error will be returned.
- If the mutate.Func returns a *NoUpdateError, the update will be skipped.
func WithRetry ¶
WithRetry attempts to update an object until successful or update becomes unnecessary (`NoUpdateError` from the `mutate.Func`). Retries are quick, with no backoff.
- If the update errors due to a `Retriable“ API status error, the object will be re-read from the server, re-mutated, and re-updated.
- If the update errors due to a ResourceVersion conflict, the object will be re-read from the server, re-mutated, and re-updated.
- If the update errors due to a UID conflict, that means the object has been deleted and re-created. So an error will be returned.
- If the mutate.Func returns a *NoUpdateError, the update will be skipped and retries will be stopped.
Types ¶
type Func ¶
type Func func() error
Func is a function which mutates an existing object into its desired state.
type NoUpdateError ¶
type NoUpdateError struct{}
NoUpdateError tells the caller that no update is required. Use with `WithRetry` and `Status` by returning a NoUpdateError from the `mutate.Func`.
func (*NoUpdateError) Error ¶
func (nue *NoUpdateError) Error() string
Error returns the error message string