managedresource

package
v1.47.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 59 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerName = "resource"

ControllerName is the name of the managedresource controller.

Variables

This section is empty.

Functions

func AddToManager

func AddToManager(mgr manager.Manager) error

AddToManager adds the controller to a Manager using the default config.

func AddToManagerWithOptions

func AddToManagerWithOptions(mgr manager.Manager, conf ControllerConfig) error

AddToManagerWithOptions adds the controller to a Manager with the given config.

func NewObjectIndex

func NewObjectIndex(references []resourcesv1alpha1.ObjectReference, withEquivalences Equivalences) *objectIndex

NewObjectIndex constructs a new *objectIndex containing all the given ObjectReferences. It can optionally be configured to use a set of rules, defining what GroupKinds to consider equivalent when looking up references using `Lookup()`, by passing in an `Equivalences` object. If the `Equivalences` object is nil, then references are only considered as equivalent if their GroupKinds are equal.

func SecretToManagedResourceMapper added in v1.35.0

func SecretToManagedResourceMapper(predicates ...predicate.Predicate) mapper.Mapper

SecretToManagedResourceMapper returns a mapper that returns requests for ManagedResources whose referenced secrets have been modified.

Types

type ControllerConfig

type ControllerConfig struct {
	MaxConcurrentWorkers      int
	SyncPeriod                time.Duration
	ClassFilter               *managerpredicate.ClassFilter
	AlwaysUpdate              bool
	ClusterID                 string
	GarbageCollectorActivated bool

	TargetCluster cluster.Cluster

	// only used for testing, defaults to 5 seconds
	RequeueAfterOnDeletionPending time.Duration
}

ControllerConfig is the completed configuration for the controller.

func (*ControllerConfig) ApplyDefaultClusterId

func (c *ControllerConfig) ApplyDefaultClusterId(ctx context.Context, log logr.Logger, restcfg *rest.Config) error

ApplyDefaultClusterId sets the cluster id according to a dedicated cluster access

type ControllerOptions

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

ControllerOptions are options for adding the controller to a Manager.

func (*ControllerOptions) AddFlags

func (o *ControllerOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds the needed command line flags to the given FlagSet.

func (*ControllerOptions) Complete

func (o *ControllerOptions) Complete() error

Complete completes the given command line flags and set the defaultControllerConfig accordingly.

func (*ControllerOptions) Completed

func (o *ControllerOptions) Completed() *ControllerConfig

Completed returns the completed ControllerConfig.

type EquivalenceSet

type EquivalenceSet map[metav1.GroupKind]struct{}

EquivalenceSet is a set of GroupKinds which should be considered as equivalent representation of an Object Kind.

func (EquivalenceSet) Insert

func (s EquivalenceSet) Insert(gks ...metav1.GroupKind) EquivalenceSet

Insert adds the given GroupKinds to the EquivalenceSet

type Equivalences

type Equivalences map[metav1.GroupKind]EquivalenceSet

Equivalences is a set of EquivalenceSets, which can be used to look up equivalent GroupKinds for a given GroupKind.

func NewEquivalences

func NewEquivalences(additionalEquivalences ...[]metav1.GroupKind) Equivalences

NewEquivalences constructs a new Equivalences object, which can be used to look up equivalent GroupKinds for a given GroupKind. It already has some default equivalences predefined (e.g. for Kind `Deployment` in Group `apps` and `extensions`). It can optionally take additional lists of GroupKinds which should be considered as equivalent representations of the respective Object Kinds.

func (Equivalences) GetEquivalencesFor

func (e Equivalences) GetEquivalencesFor(gk metav1.GroupKind) EquivalenceSet

GetEquivalencesFor looks up which GroupKinds should be considered as equivalent to a given GroupKind.

Jump to

Keyboard shortcuts

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