Documentation ¶
Index ¶
- type Interface
- type Remediator
- func (r *Remediator) ConflictErrors() []status.ManagementConflictError
- func (r *Remediator) ManagementConflict() bool
- func (r *Remediator) NeedsUpdate() bool
- func (r *Remediator) Start(ctx context.Context)
- func (r *Remediator) UpdateWatches(ctx context.Context, gvks map[schema.GroupVersionKind]struct{}) status.MultiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // NeedsUpdate returns true if the Remediator needs its watches to be updated // (typically due to some asynchronous error that occurred). NeedsUpdate() bool // UpdateWatches starts and stops server-side watches based upon the given map // of GVKs which should be watched. UpdateWatches(context.Context, map[schema.GroupVersionKind]struct{}) status.MultiError // ManagementConflict returns true if one of the watchers noticed a management conflict. ManagementConflict() bool // ConflictErrors returns the errors the remediator encounters. ConflictErrors() []status.ManagementConflictError }
Interface is a fake-able subset of the interface Remediator implements that accepts a new set of declared configuration.
Placed here to make discovering the production implementation (above) easier.
type Remediator ¶
type Remediator struct {
// contains filtered or unexported fields
}
Remediator knows how to keep the state of a Kubernetes cluster in sync with a set of declared resources. It processes a work queue of items, and ensures each matches the set of declarations passed on instantiation.
The exposed Queue operations are threadsafe - multiple callers may safely synchronously add and consume work items.
func New ¶
func New(scope declared.Scope, syncName string, cfg *rest.Config, applier syncerreconcile.Applier, decls *declared.Resources, numWorkers int) (*Remediator, error)
New instantiates launches goroutines to make the state of the connected cluster match the declared resources.
It is safe for decls to be modified after they have been passed into the Remediator.
func (*Remediator) ConflictErrors ¶
func (r *Remediator) ConflictErrors() []status.ManagementConflictError
ConflictErrors implements Interface.
func (*Remediator) ManagementConflict ¶
func (r *Remediator) ManagementConflict() bool
ManagementConflict implements Interface.
func (*Remediator) NeedsUpdate ¶
func (r *Remediator) NeedsUpdate() bool
NeedsUpdate implements Interface.
func (*Remediator) Start ¶
func (r *Remediator) Start(ctx context.Context)
Start begins the asynchronous processes for the Remediator's reconcile workers.
func (*Remediator) UpdateWatches ¶
func (r *Remediator) UpdateWatches(ctx context.Context, gvks map[schema.GroupVersionKind]struct{}) status.MultiError
UpdateWatches implements Interface.