Documentation ¶
Index ¶
- type Application
- type NopApplication
- func (c *NopApplication) Delete(_ context.Context, _ resource.Managed) (bool, error)
- func (c *NopApplication) FinalDelete(ctx context.Context, cr resource.Managed)
- func (c *NopApplication) FinalUpdate(_ context.Context, _ resource.Managed)
- func (c *NopApplication) Initialize(_ context.Context, _ resource.Managed) error
- func (c *NopApplication) Timeout(ctx context.Context, cr resource.Managed) time.Duration
- func (c *NopApplication) Update(_ context.Context, _ resource.Managed) (map[string]string, error)
- type Reconciler
- type ReconcilerOption
- func WithApplication(a Application) ReconcilerOption
- func WithFinalizer(f resource.Finalizer) ReconcilerOption
- func WithLogger(l logging.Logger) ReconcilerOption
- func WithPollInterval(after time.Duration) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
- func WithSpeedy(s map[string]int) ReconcilerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface { Initialize(ctx context.Context, cr resource.Managed) error Update(ctx context.Context, cr resource.Managed) (map[string]string, error) FinalUpdate(ctx context.Context, cr resource.Managed) Timeout(ctx context.Context, cr resource.Managed) time.Duration Delete(ctx context.Context, cr resource.Managed) (bool, error) FinalDelete(ctx context.Context, cr resource.Managed) }
type NopApplication ¶
type NopApplication struct{}
A NopApplication does nothing.
func (*NopApplication) FinalDelete ¶
func (c *NopApplication) FinalDelete(ctx context.Context, cr resource.Managed)
func (*NopApplication) FinalUpdate ¶
func (c *NopApplication) FinalUpdate(_ context.Context, _ resource.Managed)
func (*NopApplication) Initialize ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
A Reconciler reconciles managed resources by creating and managing the lifecycle of an external resource, i.e. a resource in an external network device through an API. Each controller must watch the managed resource kind for which it is responsible.
func NewReconciler ¶
func NewReconciler(m manager.Manager, of resource.ManagedKind, o ...ReconcilerOption) *Reconciler
NewReconciler returns a Reconciler that reconciles managed resources of the supplied ManagedKind. It panics if asked to reconcile a managed resource kind that is not registered with the supplied manager's runtime.Scheme. The returned Reconciler reconciles with a dummy, no-op 'external system' by default; callers should supply an ExternalConnector that returns an ExternalClient capable of managing resources in a real system.
type ReconcilerOption ¶
type ReconcilerOption func(*Reconciler)
A ReconcilerOption configures a Reconciler.
func WithApplication ¶
func WithApplication(a Application) ReconcilerOption
WithApplication specifies how the Reconciler should connect to the application logic
func WithFinalizer ¶
func WithFinalizer(f resource.Finalizer) ReconcilerOption
WithFinalizer specifies how the Reconciler should add and remove finalizers to and from the managed resource.
func WithLogger ¶
func WithLogger(l logging.Logger) ReconcilerOption
WithLogger specifies how the Reconciler should log messages.
func WithPollInterval ¶
func WithPollInterval(after time.Duration) ReconcilerOption
WithPollInterval specifies how long the Reconciler should wait before queueing a new reconciliation after a successful reconcile. The Reconciler requeues after a specified duration when it is not actively waiting for an external operation, but wishes to check whether an existing external resource needs to be synced to its ndd Managed resource.
func WithRecorder ¶
func WithRecorder(er event.Recorder) ReconcilerOption
WithRecorder specifies how the Reconciler should record events.
func WithSpeedy ¶ added in v0.0.8
func WithSpeedy(s map[string]int) ReconcilerOption