sync

package
v3.9.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adder

type Adder struct {
	Opa             OpaDataClient
	Events          <-chan event.GenericEvent
	MetricsCache    *MetricsCache
	Tracker         *readiness.Tracker
	ProcessExcluder *process.Excluder
}

func (*Adder) Add

func (a *Adder) Add(mgr manager.Manager) error

Add creates a new Sync Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

type FilteredDataClient

type FilteredDataClient struct {
	// contains filtered or unexported fields
}

FilteredDataClient is an OpaDataClient which drops any unwatched resources.

func NewFilteredOpaDataClient

func NewFilteredOpaDataClient(opa OpaDataClient, watchSet *watch.Set) *FilteredDataClient

func (*FilteredDataClient) AddData

func (f *FilteredDataClient) AddData(ctx context.Context, data interface{}) (*types.Responses, error)

AddData adds data to the opa cache if that data is currently being watched. Unwatched data is silently dropped with no error.

func (*FilteredDataClient) RemoveData

func (f *FilteredDataClient) RemoveData(ctx context.Context, data interface{}) (*types.Responses, error)

RemoveData removes data from the opa cache if that data is currently being watched. Unwatched data is silently dropped with no error.

type MetricsCache

type MetricsCache struct {
	Cache      map[string]Tags
	KnownKinds map[string]bool
	// contains filtered or unexported fields
}

func NewMetricsCache

func NewMetricsCache() *MetricsCache

func (*MetricsCache) AddObject

func (c *MetricsCache) AddObject(key string, t Tags)

func (*MetricsCache) DeleteObject

func (c *MetricsCache) DeleteObject(key string)

func (*MetricsCache) GetSyncKey

func (c *MetricsCache) GetSyncKey(namespace string, name string) string

func (*MetricsCache) ReportSync

func (c *MetricsCache) ReportSync(reporter *Reporter)

func (*MetricsCache) ResetCache

func (c *MetricsCache) ResetCache()

type OpaDataClient

type OpaDataClient interface {
	AddData(ctx context.Context, data interface{}) (*types.Responses, error)
	RemoveData(ctx context.Context, data interface{}) (*types.Responses, error)
}

OpaDataClient is an interface for caching data.

type ReconcileSync

type ReconcileSync struct {
	// contains filtered or unexported fields
}

ReconcileSync reconciles an arbitrary object described by Kind.

func (*ReconcileSync) Reconcile

func (r *ReconcileSync) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for an object and makes changes based on the state read and what is in the constraint.Spec.

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

func NewStatsReporter

func NewStatsReporter() (*Reporter, error)

NewStatsReporter creates a reporter for sync metrics.

type Tags

type Tags struct {
	Kind   string
	Status metrics.Status
}

Jump to

Keyboard shortcuts

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