Documentation ¶
Index ¶
- func Retriable(err error) bool
- func RetriableOrConflict(err error) bool
- func Spec(ctx context.Context, c client.Client, obj client.Object, mutateFn Func, ...) (bool, error)
- func Status(ctx context.Context, c client.Client, obj client.Object, mutateFn Func, ...) (bool, error)
- type Func
- type NoUpdateError
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 Spec ¶ added in v1.17.0
func Spec(ctx context.Context, c client.Client, obj client.Object, mutateFn Func, opts ...client.UpdateOption) (bool, error)
Spec attempts to update an object until successful or update becomes unnecessary (`NoUpdateError` from the `mutate.Func`). Retries are quick, with no backoff. Returns an error if the status update fails OR if the mutate func fails.
func Status ¶
func Status(ctx context.Context, c client.Client, obj client.Object, mutateFn Func, opts ...client.UpdateOption) (bool, error)
Status attempts to update the status of an object until successful or update becomes unnecessary (`NoUpdateError` from the `mutate.Func`). Retries are quick, with no backoff. Returns an error if the status update fails OR if the mutate func fails OR if the generation changes before the status update succeeds.
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