types

package
v0.0.0-...-3500608 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SourceParseErrorEnableDestroy means that the Destroy operation is enabled
	// even if a source instance fails to parse; therefore, a currently enrolled
	// instance will be removed if the associated source instance fails to parse.
	// This is a the default operation on a source instance parse error.
	SourceParseErrorEnableDestroy = "EnableDestroy"

	// SourceParseErrorDisableDestroy means that the Destroy operation is disabled
	// whenever any source instance fails to parse; therefore, no enrolled instances
	// will be removed if any source instance fails to parse.
	SourceParseErrorDisableDestroy = "DisableDestroy"

	// EnrolledParseErrorEnableProvision means that the Provision operation is enabled
	// even if an enrolled instance fails to parse; therefore, an instance may be enrolled
	// multiple times.
	// This is a the default operation on a enrolled instance parse error.
	EnrolledParseErrorEnableProvision = "EnableProvision"

	// EnrolledParseErrorDisableProvision means that the Provision operation is disabled
	// whenever any enrolled instance fails to parse; therefore, no source instances will
	// be added if any of the currently enrolled instances fails to parse.
	EnrolledParseErrorDisableProvision = "DisableProvision"

	// PluginInit is the phase when the enroller is created, used when validating options
	PluginInit = iota
	// PluginCommit is the phase when the spec is commited, used when validating options
	PluginCommit
)

Variables

This section is empty.

Functions

func ResolveDependencies

func ResolveDependencies(spec types.Spec) (depends.Runnables, error)

ResolveDependencies returns a list of dependencies by parsing the opaque Properties blob.

func TemplateFrom

func TemplateFrom(source []byte) (*template.Template, error)

TemplateFrom returns a template after it has un-escaped any escape sequences

Types

type ListSourceUnion

type ListSourceUnion types.Any

ListSourceUnion is a union type of possible values: a list of []intsance.Description a group plugin name

func (*ListSourceUnion) GroupPlugin

func (u *ListSourceUnion) GroupPlugin() (plugin.Name, error)

GroupPlugin tries to 'cast' the union value as a group plugin name

func (*ListSourceUnion) InstanceDescriptions

func (u *ListSourceUnion) InstanceDescriptions() ([]instance.Description, error)

InstanceDescriptions tries to 'cast' the union as list of descriptions

func (*ListSourceUnion) MarshalJSON

func (u *ListSourceUnion) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*ListSourceUnion) UnmarshalJSON

func (u *ListSourceUnion) UnmarshalJSON(buff []byte) error

UnmarshalJSON implements json.Unmarshaler

type Options

type Options struct {

	// SourceKeySelector is a string template for selecting the join key from
	// a source instance.Description. This selector template should use escapes
	// so that the template {{ and }} are preserved.  For example,
	// SourceKeySelector: \{\{ .ID \}\}  # selects the ID field.
	SourceKeySelector string

	// SourceParseErrPolicy defines the behavior when the source item cannot
	// be indexed, value values are "EnableDestroy" and "DisableDestroy
	SourceParseErrPolicy string

	// EnrollmentKeySelector is a string template for selecting the join key from
	// a enrollment plugin's instance.Description.
	EnrollmentKeySelector string

	// EnrollmentParseErrPolicy defines the behavior when the enrolled item cannot
	// be indexed, value values are "EnableProvision" and "DisableProvision"
	EnrollmentParseErrPolicy string

	// SyncInterval is the time interval between reconciliation. Syntax
	// is go's time.Duration string representation (e.g. 1m, 30s)
	SyncInterval types.Duration

	// DestroyOnTerminiate tells the controller to call instace.Destroy
	// for each member it is maintaining.  This is a matter of ownership
	// depending on use cases the controller may not *own* the data in the
	// downstream instance.  The controller merely reconciles it.
	DestroyOnTerminate bool
}

Options is the controller options

func (Options) Validate

func (o Options) Validate(phase PluginPhase) error

Validate ensures that source and enrolled parse error operation values are valid in the given options

type PluginPhase

type PluginPhase int

PluginPhase defines the enroller lifecycle

type PluginSpec

type PluginSpec struct {
	// Plugin is the name of the instance plugin
	Plugin plugin.Name

	// Labels are the labels to use when querying for instances. This is the namespace.
	Labels map[string]string

	// Properties is the properties to configure the instance with.
	Properties *types.Any `json:",omitempty" yaml:",omitempty"`
}

PluginSpec has information about the plugin

type Properties

type Properties struct {

	// List is a list of instance descriptions to sync
	List *ListSourceUnion `json:",omitempty" yaml:",omitempty"`

	// Instance is the name of the instance plugin which will receive the
	// synchronization messages of provision / destroy based on the
	// changes in the List
	Instance PluginSpec
}

Properties is the schema of the configuration in the types.Spec.Properties

Jump to

Keyboard shortcuts

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