managedresource

package
v1.99.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const ControllerName = "managedresource"

ControllerName is the name of the controller.

Variables

This section is empty.

Functions

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.

Types

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.

type Reconciler

type Reconciler struct {
	SourceClient                  client.Client
	TargetClient                  client.Client
	TargetScheme                  *runtime.Scheme
	TargetRESTMapper              meta.RESTMapper
	Config                        config.ManagedResourceControllerConfig
	Clock                         clock.Clock
	ClassFilter                   *resourcemanagerpredicate.ClassFilter
	ClusterID                     string
	GarbageCollectorActivated     bool
	RequeueAfterOnDeletionPending *time.Duration
}

Reconciler manages the resources reference by ManagedResources.

func (*Reconciler) AddToManager added in v1.59.0

func (r *Reconciler) AddToManager(ctx context.Context, mgr manager.Manager, sourceCluster, targetCluster cluster.Cluster) error

AddToManager adds Reconciler to the given manager.

func (*Reconciler) MapSecretToManagedResources added in v1.59.0

func (r *Reconciler) MapSecretToManagedResources(managedResourcePredicates ...predicate.Predicate) mapper.MapFunc

MapSecretToManagedResources maps secrets to relevant ManagedResources.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile manages the resources reference by ManagedResources.

Jump to

Keyboard shortcuts

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