Documentation ¶
Index ¶
- Constants
- func NewObjectIndex(references []resourcesv1alpha1.ObjectReference, withEquivalences Equivalences) *objectIndex
- type EquivalenceSet
- type Equivalences
- type Reconciler
- func (r *Reconciler) AddToManager(ctx context.Context, mgr manager.Manager, ...) error
- func (r *Reconciler) MapSecretToManagedResources(managedResourcePredicates ...predicate.Predicate) mapper.MapFunc
- func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)
Constants ¶
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 ¶
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.