Documentation ¶
Index ¶
- Constants
- type ClassFilter
- func (f *ClassFilter) Active(o runtime.Object) (action bool, responsible bool)
- func (f *ClassFilter) Create(e event.CreateEvent) bool
- func (f *ClassFilter) Delete(e event.DeleteEvent) bool
- func (f *ClassFilter) FinalizerName() string
- func (f *ClassFilter) Generic(e event.GenericEvent) bool
- func (f *ClassFilter) ResourceClass() string
- func (f *ClassFilter) Responsible(o runtime.Object) bool
- func (f *ClassFilter) Update(e event.UpdateEvent) bool
- type EquivalenceSet
- type Equivalences
- type ObjectIndex
- type Reconciler
- type SecretReconciler
Constants ¶
const DefaultClass = "resources"
DefaultClass is used a resource class is no class is specified on the command line
const ( // FinalizerName is the finalizer base name that is injected into ManagedResources. // The concrete finalizer is finally componed by this base name and the resource class. FinalizerName = "resources.gardener.cloud/gardener-resource-manager" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassFilter ¶
type ClassFilter struct {
// contains filtered or unexported fields
}
ClassFilter keeps the resource class for the actual controller instance and is used as Filter predicate for events finally passed to the controller
func NewClassFilter ¶
func NewClassFilter(class string) *ClassFilter
NewClassFilter returns a new `ClassFilter` instance.
func (*ClassFilter) Active ¶
func (f *ClassFilter) Active(o runtime.Object) (action bool, responsible bool)
Active checks whether a dedicated object must be handled by the actual controller instance. This is split into two conditions. An object must be handled if it has already been handled, indicated by the actual finalizer, or if the actual controller is responsible for the object.
func (*ClassFilter) Create ¶
func (f *ClassFilter) Create(e event.CreateEvent) bool
Create implements `predicate.Predicate`.
func (*ClassFilter) Delete ¶
func (f *ClassFilter) Delete(e event.DeleteEvent) bool
Delete implements `predicate.Predicate`.
func (*ClassFilter) FinalizerName ¶
func (f *ClassFilter) FinalizerName() string
FinalizerName determines the finalizer name to be used for the actual resource class
func (*ClassFilter) Generic ¶
func (f *ClassFilter) Generic(e event.GenericEvent) bool
Generic implements `predicate.Predicate`.
func (*ClassFilter) ResourceClass ¶
func (f *ClassFilter) ResourceClass() string
ResourceClass returns the actually configured resource class
func (*ClassFilter) Responsible ¶
func (f *ClassFilter) Responsible(o runtime.Object) bool
Responsible checks whether an object should be managed by the actual controller instance
func (*ClassFilter) Update ¶
func (f *ClassFilter) Update(e event.UpdateEvent) bool
Update implements `predicate.Predicate`.
type EquivalenceSet ¶ added in v0.13.0
EquivalenceSet is a set of GroupKinds which should be considered as equivalent representation of an Object Kind.
func (EquivalenceSet) Insert ¶ added in v0.13.0
func (s EquivalenceSet) Insert(gks ...metav1.GroupKind) EquivalenceSet
Insert adds the given GroupKinds to the EquivalenceSet
type Equivalences ¶ added in v0.13.0
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 ¶ added in v0.13.0
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 ¶ added in v0.13.0
func (e Equivalences) GetEquivalencesFor(gk metav1.GroupKind) EquivalenceSet
GetEquivalencesFor looks up which GroupKinds should be considered as equivalent to a given GroupKind.
type ObjectIndex ¶
type ObjectIndex struct {
// contains filtered or unexported fields
}
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 (*ObjectIndex) Found ¶
func (i *ObjectIndex) Found(ref resourcesv1alpha1.ObjectReference) bool
Found checks if a given ObjectReference was found previously by a call to `Lookup()`.
func (*ObjectIndex) Lookup ¶
func (i *ObjectIndex) Lookup(ref resourcesv1alpha1.ObjectReference) (resourcesv1alpha1.ObjectReference, bool)
Lookup checks if the index contains a given ObjectReference. It also considers cross API group equivalences configured by the Equivalences object handed to NewObjectIndex(). It returns the found ObjectReference and a bool indicating if it was found. If the reference (or equivalent one) was found it is marked as `found`, which can be later checked by using `Found()`.
func (*ObjectIndex) Objects ¶
func (i *ObjectIndex) Objects() map[string]resourcesv1alpha1.ObjectReference
Objects returns a map containing all ObjectReferences of the index. It maps keys of the contained objects (in the form `Group/Kind/Namespace/Name`) to ObjectReferences.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler contains information in order to reconcile instances of ManagedResource.
func NewReconciler ¶
func NewReconciler(ctx context.Context, log logr.Logger, c, targetClient client.Client, targetRESTMapper *restmapper.DeferredDiscoveryRESTMapper, targetScheme *runtime.Scheme, class *ClassFilter, alwaysUpdate bool, syncPeriod time.Duration) *Reconciler
NewReconciler creates a new reconciler with the given target client.
type SecretReconciler ¶ added in v0.13.0
type SecretReconciler struct {
// contains filtered or unexported fields
}
SecretSecretReconciler adds/removes finalizers to/from secrets referenced by ManagedResources.
func NewSecretReconciler ¶ added in v0.13.0
func NewSecretReconciler(log logr.Logger, class *ClassFilter) *SecretReconciler
NewSecretReconciler creates a new secret reconciler.
func (*SecretReconciler) InjectClient ¶ added in v0.13.0
func (r *SecretReconciler) InjectClient(client client.Client) error
InjectClient injects a client into the reconciler.
func (*SecretReconciler) InjectStopChannel ¶ added in v0.13.0
func (r *SecretReconciler) InjectStopChannel(stopCh <-chan struct{}) error
InjectStopChannel injects a stop channel into the reconciler.