Documentation ¶
Index ¶
- type Interface
- type Remediator
- func (r *Remediator) ConflictErrors() []status.ManagementConflictError
- func (r *Remediator) FightErrors() []status.Error
- func (r *Remediator) ManagementConflict() bool
- func (r *Remediator) NeedsUpdate() bool
- func (r *Remediator) Pause()
- func (r *Remediator) Resume()
- func (r *Remediator) Start(ctx context.Context) <-chan struct{}
- 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 { // Pause the Remediator by stopping the workers and waiting for them to be done. Pause() // Resume the Remediator by starting the workers. Resume() // 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 // FightErrors returns the fight errors (KNV2005) the remediator encounters. FightErrors() []status.Error }
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) FightErrors ¶ added in v1.15.1
func (r *Remediator) FightErrors() []status.Error
FightErrors 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) Pause ¶ added in v1.15.1
func (r *Remediator) Pause()
Pause the Remediator by stopping the workers and waiting for them to be done.
func (*Remediator) Resume ¶ added in v1.15.1
func (r *Remediator) Resume()
Resume the Remediator by starting the workers.
func (*Remediator) Start ¶
func (r *Remediator) Start(ctx context.Context) <-chan struct{}
Start the Remediator's asynchronous reconcile workers. Returns a done channel that will be closed after the context is cancelled and all the workers have exited.
func (*Remediator) UpdateWatches ¶
func (r *Remediator) UpdateWatches(ctx context.Context, gvks map[schema.GroupVersionKind]struct{}) status.MultiError
UpdateWatches implements Interface.