Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler interface {
// Confirgure permit to init external provider driver (API client REST)
// It can also permit to init condition on status
Configure(ctx context.Context, req ctrl.Request, resource resource.Resource) (meta any, err error)
// Read permit to read the actual resource state from provider and set it on data map
Read(ctx context.Context, r resource.Resource, data map[string]any, meta any) (res ctrl.Result, err error)
// Create permit to create resource on provider
// It only call if diff.NeeCreated is true
Create(ctx context.Context, r resource.Resource, data map[string]any, meta any) (res ctrl.Result, err error)
// Update permit to update resource on provider
// It only call if diff.NeedUpdated is true
Update(ctx context.Context, r resource.Resource, data map[string]any, meta any) (res ctrl.Result, err error)
// Delete permit to delete resource on provider
// It only call if you have specified finalizer name when you create reconciler and if resource as marked to be deleted
Delete(ctx context.Context, r resource.Resource, data map[string]any, meta any) (err error)
// OnError is call when error is throwing
// It the right way to set status condition when error
OnError(ctx context.Context, r resource.Resource, data map[string]any, meta any, err error)
// OnSuccess is call at the end if no error
// It's the right way to set status condition when everithink is good
OnSuccess(ctx context.Context, r resource.Resource, data map[string]any, meta any, diff Diff) (err error)
// Diff permit to compare the actual state and the expected state
Diff(r resource.Resource, data map[string]any, meta any) (diff Diff, err error)
}
type StdReconciler ¶
func NewStdReconciler ¶
func NewStdReconciler(client client.Client, finalizer string, reconciler Reconciler, logger *logrus.Entry, recorder record.EventRecorder, waitDurationOnError time.Duration) (stdReconciler *StdReconciler, err error)
Click to show internal directories.
Click to hide internal directories.