Documentation
¶
Index ¶
- func HasComponentLabel() client.ListOption
- type ConvertFunc
- type DetectorContext
- type FilterCriteria
- type ObjectComponent
- type ObjectReconciler
- func (r *ObjectReconciler) DetectOrphanedComponents(ctx context.Context, configuredComponents []juggler.Component) ([]juggler.Component, error)
- func (r *ObjectReconciler) Install(ctx context.Context, component juggler.Component) error
- func (r *ObjectReconciler) KnownTypes() []reflect.Type
- func (r *ObjectReconciler) Observe(ctx context.Context, comp juggler.Component) (juggler.ComponentObservation, error)
- func (r *ObjectReconciler) PreInstall(ctx context.Context, component juggler.Component) error
- func (r *ObjectReconciler) PreUninstall(ctx context.Context, component juggler.Component) error
- func (r *ObjectReconciler) PreUpdate(ctx context.Context, component juggler.Component) error
- func (r *ObjectReconciler) RegisterType(comps ...ObjectComponent)
- func (r *ObjectReconciler) Uninstall(ctx context.Context, component juggler.Component) error
- func (r *ObjectReconciler) Update(ctx context.Context, component juggler.Component) error
- type OrphanedObjectsDetector
- type SameFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasComponentLabel ¶
func HasComponentLabel() client.ListOption
Types ¶
type ConvertFunc ¶
type ConvertFunc func(list client.ObjectList) []juggler.Component
type DetectorContext ¶
type DetectorContext struct { // FilterCriteria describes a list of Options which identify all objects which can // potentially become orphaned. This should exclude objects created by the end-user FilterCriteria FilterCriteria // ConvertFunc is a transformation-func which converts a list of orphaned objects // into a list of known juggler components ConvertFunc ConvertFunc // SameFunc is a comparison-func which allows to compare two juggler components SameFunc SameFunc // ListType describes the type the applied object should have inside the cluster ListType client.ObjectList }
type FilterCriteria ¶
type FilterCriteria []client.ListOption
type ObjectComponent ¶
type ObjectComponent interface { juggler.Component // BuildObjectToReconcile returns an empty API object of the type that the ObjectComponent represents. // The object's desired state must be reconciled with the existing state inside the ReconcileObject(...) function. // It is called regardless of creating or updating an object. // Any information (also in `metadata`, e.g. labels) will be overridden before ReconcileObject(...) is called. BuildObjectToReconcile(ctx context.Context) (client.Object, types.NamespacedName, error) // ReconcileObject brings the client.Object closer to the desired state. ReconcileObject(ctx context.Context, obj client.Object) error // IsObjectHealthy returns if the object is healthy. IsObjectHealthy(obj client.Object) juggler.ResourceHealthiness }
ObjectComponent is an interface for manageable components, specifically for plain client.Objects.
type ObjectReconciler ¶
type ObjectReconciler struct {
// contains filtered or unexported fields
}
func NewReconciler ¶
func NewReconciler(logger logr.Logger, remoteClient client.Client) *ObjectReconciler
func (*ObjectReconciler) DetectOrphanedComponents ¶
func (r *ObjectReconciler) DetectOrphanedComponents( ctx context.Context, configuredComponents []juggler.Component, ) ([]juggler.Component, error)
DetectOrphanedComponents implements juggler.OrphanedComponentsDetector.
func (*ObjectReconciler) KnownTypes ¶
func (r *ObjectReconciler) KnownTypes() []reflect.Type
KnownTypes implements juggler.ComponentReconciler.
func (*ObjectReconciler) Observe ¶
func (r *ObjectReconciler) Observe(ctx context.Context, comp juggler.Component) (juggler.ComponentObservation, error)
Observe implements ComponentReconciler.
func (*ObjectReconciler) PreInstall ¶
PreInstall implements juggler.ComponentReconciler.
func (*ObjectReconciler) PreUninstall ¶
PreUninstall implements ComponentReconciler.
func (*ObjectReconciler) RegisterType ¶
func (r *ObjectReconciler) RegisterType(comps ...ObjectComponent)
type OrphanedObjectsDetector ¶
type OrphanedObjectsDetector interface {
OrphanDetectorContext() DetectorContext
}
OrphanedObjectsDetector describes an interface for handling orphaned resources. It should be implemented by MCP components which can leave orphaned resources after said component is being removed from the MCP
Click to show internal directories.
Click to hide internal directories.