controller

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// Plan is a commit without actually making the changes.  The controller returns a proposed object state
	// after commit, with a Plan, or error.
	DoPlan func(operation controller.Operation, spec types.Spec) (types.Object, controller.Plan, error)

	// Commit commits the spec to the controller for management.  The controller's job is to ensure reality
	// matches the specification.  The spec can be composed and references other controllers or plugins.
	// When a spec is committed to a controller, the controller returns the object state corresponding to
	// the spec.  When operation is Destroy, only Metadata portion of the spec is needed to identify
	// the object to be destroyed.
	DoCommit func(operation controller.Operation, spec types.Spec) (types.Object, error)

	// Describe returns a list of objects matching the metadata provided. A list of objects are possible because
	// metadata can be a tags search.  An object has state, and its original spec can be accessed as well.
	// A nil Metadata will instruct the controller to return all objects under management.
	DoDescribe func(metadata *types.Metadata) ([]types.Object, error)

	// Free tells the controller to pause management of objects matching.  To resume, commit again.
	DoFree func(metadata *types.Metadata) ([]types.Object, error)
}

Controller implements the controller.Controller interface and supports testing by letting user assemble behavior dyanmically.

func (*Controller) Commit

func (t *Controller) Commit(operation controller.Operation, spec types.Spec) (types.Object, error)

Commit implements pkg/controller/Controller.Commit

func (*Controller) Describe

func (t *Controller) Describe(metadata *types.Metadata) ([]types.Object, error)

Describe implements pkg/controller/Controller.Describe

func (*Controller) Free

func (t *Controller) Free(metadata *types.Metadata) ([]types.Object, error)

Free implements pkg/controller/Controller.Free

func (*Controller) Plan

func (t *Controller) Plan(operation controller.Operation, spec types.Spec) (types.Object, controller.Plan, error)

Plan implements pkg/controller/Controller.Plan

Jump to

Keyboard shortcuts

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