Documentation
¶
Index ¶
- type Builder
- func (b *Builder[Parent, Child]) AddCompareOpt(compareOpts []cmp.Option) *Builder[Parent, Child]
- func (b *Builder[Parent, Child]) Build() *Reconciler[Parent, Child]
- func (b *Builder[Parent, Child]) WithChildKeyFn(childKeyFn func(Parent) Child) *Builder[Parent, Child]
- func (b *Builder[Parent, Child]) WithDetails(details api.Descriptor) *Builder[Parent, Child]
- func (b *Builder[Parent, Child]) WithDryRunType(dryRunType reconciler.DryRunType) *Builder[Parent, Child]
- func (b *Builder[Parent, Child]) WithNoReference(noReference bool) *Builder[Parent, Child]
- func (b *Builder[Parent, Child]) WithPreUpdateFn(...) *Builder[Parent, Child]
- func (b *Builder[Parent, Child]) WithPredicateFn(predicate func(parent Parent) bool) *Builder[Parent, Child]
- func (b *Builder[Parent, Child]) WithShouldDeleteFn(shouldDeleteFn func(Parent) bool) *Builder[Parent, Child]
- type ReconcileFn
- type Reconciler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder[Parent client.Object, Child client.Object] struct { // contains filtered or unexported fields }
Builder is a builder for the Reconciler.
func FromReconcileFunc ¶
func FromReconcileFunc[Parent client.Object, Child client.Object](fn ReconcileFn[Parent, Child]) *Builder[Parent, Child]
FromReconcileFunc returns a new instance of Builder for the ReconcileFn
func (*Builder[Parent, Child]) AddCompareOpt ¶
AddCompareOpt adds a comparator option to the reconciler
func (*Builder[Parent, Child]) Build ¶
func (b *Builder[Parent, Child]) Build() *Reconciler[Parent, Child]
Build returns the constructed Reconciler.
func (*Builder[Parent, Child]) WithChildKeyFn ¶
func (*Builder[Parent, Child]) WithDetails ¶
func (b *Builder[Parent, Child]) WithDetails(details api.Descriptor) *Builder[Parent, Child]
WithDetails sets the Details field.
func (*Builder[Parent, Child]) WithDryRunType ¶
func (b *Builder[Parent, Child]) WithDryRunType(dryRunType reconciler.DryRunType) *Builder[Parent, Child]
WithDryRunType configures the dry-run behavior of the reconciler.
func (*Builder[Parent, Child]) WithNoReference ¶
WithNoReference sets the NoReference field.
func (*Builder[Parent, Child]) WithPreUpdateFn ¶ added in v0.0.5
func (*Builder[Parent, Child]) WithPredicateFn ¶
func (b *Builder[Parent, Child]) WithPredicateFn(predicate func(parent Parent) bool) *Builder[Parent, Child]
WithPredicateFn sets the PredicateFn field.
func (*Builder[Parent, Child]) WithShouldDeleteFn ¶
type ReconcileFn ¶
type Reconciler ¶
type Reconciler[Parent client.Object, Child client.Object] struct { // Details is the descriptor for the reconciler. // It should contain the name and description of the reconciler for documentation and debugging purposes. Details api.Descriptor // required // ReconcileFn is the function that reconciles the Child object. // The ReconcileFn accepts a Parent object, and returns the desired state of the Child object, or an error. ReconcileFn func(ctx context.Context, parent Parent) (Child, error) // required // PredicateFn is a function that returns true if the ReconcileFn should be called. // If nil, the ReconcileFn will always be called. PredicateFn func(parent Parent) bool // optional // NoReference optionally disables setting the owner reference on the child object. NoReference bool // optional // DryRunType configures the dry-run behavior of the reconciler. DryRunType reconciler.DryRunType // optional // CompareOpts are the options to use when comparing the child object to the desired state. // This helps avoid unnecessary updates when the child object is already in the desired state. CompareOpts []cmp.Option // optional // ShouldDeleteFn is a function that if returns true, the child object will be deleted. // It is called regardless of the PredicateFn function. If no function is provided, the child object will never be deleted. ShouldDeleteFn func(Parent) bool // optional // ChildKeyFn returns the child object with only a key (name and namespace) set. // It must always match the key the ReconcileFn returns. Otherwise, Reconcile calls will fail. // All other fields should be empty and will be ignored. ChildKeyFn func(Parent) Child // required if ShouldDeleteFn is set // PreUpdateFn is a function that is called before the child object is applied. // This function is not called for the first creation of the child object. PreUpdateFn func(ctx context.Context, parent Parent, previous, child Child) error // optional }
Reconciler (SimpleReconciler) is a simple reconciler that reconciles a child object for a parent object.
func (*Reconciler[Parent, Child]) Describe ¶
func (r *Reconciler[Parent, Child]) Describe() api.Descriptor
Describe returns the descriptor for the reconciler.
Click to show internal directories.
Click to hide internal directories.