managed

package
v0.0.85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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) Delete

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

func (c *NopApplication) Initialize(_ context.Context, _ resource.Managed) error

func (*NopApplication) Timeout

func (*NopApplication) Update

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.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

Reconcile a managed resource with an external resource.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL