remediator

package
v1.14.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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) <-chan struct{}

Start begins the asynchronous processes for the Remediator's reconcile workers. Returns a done channel that will be closed after 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL