Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Enforce represents create, update, reconcile operations Enforce = iota // Destroy is the destroy operation. Destroy also implies Free. Destroy )
Variables ¶
View Source
var ( // InterfaceSpec is the current name and version of the Instance API. InterfaceSpec = spi.InterfaceSpec{ Name: "Controller", Version: "0.1.0", } )
Functions ¶
func CancelWait ¶
func CancelWait(p Controller)
CancelWait stops the plugin from waiting / retrying to connect
Types ¶
type Controller ¶
type Controller interface { // Plan is a commit without actually making the changes. The controller returns a proposed object state // after commit, with a Plan, or error. Plan(Operation, types.Spec) (types.Object, Plan, error) // Commit commits the spec to the controller for management or destruction. The controller's job is to ensure reality // matches the operation and 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. Commit(Operation, 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. Describe(*types.Metadata) ([]types.Object, error) // Free tells the controller to pause management of objects matching. To resume, commit again. Free(*types.Metadata) ([]types.Object, error) }
Controller is the interface that all controllers implement. Controllers are managed by pkg/manager/Manager
func LazyConnect ¶
func LazyConnect(finder func() (Controller, error), retry time.Duration) Controller
LazyConnect returns a Controller that defers connection to actual method invocation and can optionally block until the connection is made.
type Plan ¶
type Plan struct { // Message contains human-friendly message Message []string }
Plan models the steps the controller will take to fulfill specification when committed.
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
Poller is the entity that executes a unit of work at a predefined interval
Click to show internal directories.
Click to hide internal directories.