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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SkipBeforeInstanceDestroyDrain is the policy that the node is not be
	// drained before the instance is destroyed
	SkipBeforeInstanceDestroyDrain = SkipBeforeInstanceDestroy("drain")
)

Functions

func ResolveDependencies

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

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

func UnparseProperties

func UnparseProperties(id string, props Spec) (group.Spec, error)

UnparseProperties composes group.spec from id and props

Types

type FlavorPlugin

type FlavorPlugin struct {
	Plugin     plugin.Name
	Properties *types.Any // this will be the Spec of the plugin
}

FlavorPlugin describes the flavor configuration

type InstancePlugin

type InstancePlugin struct {
	Plugin     plugin.Name
	Properties *types.Any // this will be the Spec of the plugin
}

InstancePlugin is the structure that describes an instance plugin.

type Options

type Options struct {

	// Self is set when the controller is part of a group that can be updated.
	Self *instance.LogicalID

	// PollInterval is the frequency for syncing the state
	PollInterval types.Duration

	// MaxParallelNum is the max number of parallel instance operation. Default =0 (no limit)
	MaxParallelNum uint

	// PollIntervalGroupSpec polls for group spec at this interval to update the metadata paths
	PollIntervalGroupSpec types.Duration

	// PollIntervalGroupDetail polls for group details at this interval to update the metadata paths
	PollIntervalGroupDetail types.Duration
}

Options capture the options for starting up the group controller.

type SkipBeforeInstanceDestroy

type SkipBeforeInstanceDestroy string

SkipBeforeInstanceDestroy defines the action that should be skipped prior destroying the instance.

func (SkipBeforeInstanceDestroy) MarshalJSON

func (s SkipBeforeInstanceDestroy) MarshalJSON() ([]byte, error)

MarshalJSON returns the json representation

func (*SkipBeforeInstanceDestroy) UnmarshalJSON

func (s *SkipBeforeInstanceDestroy) UnmarshalJSON(buff []byte) error

UnmarshalJSON unmarshals the buffer to this struct

type Spec

type Spec struct {
	Instance   InstancePlugin
	Flavor     FlavorPlugin
	Allocation group.AllocationMethod
	Updating   Updating
}

Spec is the configuration schema for the plugin, provided in group.Spec.Properties

func MustParse

func MustParse(s Spec, e error) Spec

MustParse can be wrapped over ParseProperties to panic if parsing fails.

func ParseProperties

func ParseProperties(config group.Spec) (Spec, error)

ParseProperties parses the group plugin properties JSON document in a group configuration.

func (Spec) InstanceHash

func (c Spec) InstanceHash() string

InstanceHash computes a stable hash of the document in InstancePluginProperties.

type Updating

type Updating struct {
	Duration                  types.Duration
	Count                     int
	SkipBeforeInstanceDestroy *SkipBeforeInstanceDestroy
}

Updating is the configuration schema using on a rolling update and defines how long a node must be healthy before the next node is updated. If Duration is set then the node must be healthy for at least the specified time. If Count is set then the node must be healthy for specified number of poll intervals. Both Duration and Count cannot be non 0.

Jump to

Keyboard shortcuts

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