Documentation ¶
Index ¶
Constants ¶
const ( // RESTConfigTimeout sets the REST config timeout for the remediator to 1 hour. // // RESTConfigTimeout should be longer than 2*minWatchTimeout to respect // the watch timeout set by `ListOptions.TimeoutSeconds` in the watch // create requests. RESTConfigTimeout = time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager accepts new resource lists that are parsed from Git and then updates declared resources and get GVKs.
func NewManager ¶
func NewManager(scope declared.Scope, syncName string, cfg *rest.Config, q *queue.ObjectQueue, decls *declared.Resources, options *Options, addConflictErrorFunc func(status.ManagementConflictError), removeConflictErrorFunc func(status.ManagementConflictError)) (*Manager, error)
NewManager starts a new watch manager
func (*Manager) ManagementConflict ¶
ManagementConflict returns true if any watcher notices any management conflicts. This function is threadsafe.
func (*Manager) NeedsUpdate ¶
NeedsUpdate returns true if the Manager's watches need to be updated. This function is threadsafe.
func (*Manager) UpdateWatches ¶
func (m *Manager) UpdateWatches(ctx context.Context, gvkMap map[schema.GroupVersionKind]struct{}) status.MultiError
UpdateWatches accepts a map of GVKs that should be watched and takes the following actions:
- stop watchers for any GroupVersionKind that is not present in the given map.
- start watchers for any GroupVersionKind that is present in the given map and not present in the current watch map.
This function is threadsafe.
type Options ¶
type Options struct { // Mapper is the RESTMapper to use for mapping GroupVersionKinds to Resources. Mapper meta.RESTMapper // contains filtered or unexported fields }
Options contains options for creating a watch manager.
type Runnable ¶
type Runnable interface { Stop() Run(ctx context.Context) status.Error ManagementConflict() bool SetManagementConflict(object client.Object) ClearManagementConflict() // contains filtered or unexported methods }
Runnable defines the custom watch interface.
func NewFiltered ¶
NewFiltered returns a new filtered watch initialized with the given options.