provisioner

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewLxcBroker = newLxcBroker

Override for testing.

View Source
var (
	StartProvisioner = startProvisionerWorker
)

Override for testing.

Functions

func NewContainerSetupHandler

func NewContainerSetupHandler(params ContainerSetupParams) worker.StringsWatchHandler

NewContainerSetupHandler returns a StringsWatchHandler which is notified when containers are created on the given machine.

func NewKvmBroker

func NewKvmBroker(
	api APICalls,
	agentConfig agent.Config,
	managerConfig container.ManagerConfig,
	enableNAT bool,
) (environs.InstanceBroker, error)

Types

type APICalls

type APICalls interface {
	ContainerConfig() (params.ContainerConfig, error)
	PrepareContainerInterfaceInfo(names.MachineTag) ([]network.InterfaceInfo, error)
	GetContainerInterfaceInfo(names.MachineTag) ([]network.InterfaceInfo, error)
}

type ClassifiableMachine

type ClassifiableMachine interface {
	Life() params.Life
	InstanceId() (instance.Id, error)
	EnsureDead() error
	Status() (params.Status, string, error)
	Id() string
}

type ContainerSetup

type ContainerSetup struct {
	// contains filtered or unexported fields
}

ContainerSetup is a StringsWatchHandler that is notified when containers are created on the given machine. It will set up the machine to be able to create containers and start a suitable provisioner.

func (*ContainerSetup) Handle

func (cs *ContainerSetup) Handle(containerIds []string) (resultError error)

Handle is called whenever containers change on the machine being watched. Machines start out with no containers so the first time Handle is called, it will be because a container has been added.

func (*ContainerSetup) SetUp

func (cs *ContainerSetup) SetUp() (watcher watcher.StringsWatcher, err error)

SetUp is defined on the StringsWatchHandler interface.

func (*ContainerSetup) TearDown

func (cs *ContainerSetup) TearDown() error

TearDown is defined on the StringsWatchHandler interface.

type ContainerSetupParams

type ContainerSetupParams struct {
	Runner              worker.Runner
	WorkerName          string
	SupportedContainers []instance.ContainerType
	ImageURLGetter      container.ImageURLGetter
	Machine             *apiprovisioner.Machine
	Provisioner         *apiprovisioner.State
	Config              agent.Config
	InitLock            *fslock.Lock
}

ContainerSetupParams are used to initialise a container setup handler.

type IptablesRule

type IptablesRule struct {
	Table string
	Chain string
	Rule  string
}

type MachineClassification

type MachineClassification string
const (
	None     MachineClassification = "none"
	Pending  MachineClassification = "Pending"
	Dead     MachineClassification = "Dead"
	Maintain MachineClassification = "Maintain"
)

type MachineGetter

type MachineGetter interface {
	Machine(names.MachineTag) (*apiprovisioner.Machine, error)
	MachinesWithTransientErrors() ([]*apiprovisioner.Machine, []params.StatusResult, error)
}

type Provisioner

type Provisioner interface {
	worker.Worker
	Stop() error
	// contains filtered or unexported methods
}

Provisioner represents a running provisioner worker.

func NewContainerProvisioner

func NewContainerProvisioner(
	containerType instance.ContainerType,
	st *apiprovisioner.State,
	agentConfig agent.Config,
	broker environs.InstanceBroker,
	toolsFinder ToolsFinder,
) Provisioner

NewContainerProvisioner returns a new Provisioner. When new machines are added to the state, it allocates instances from the environment and allocates them to the new machines.

func NewEnvironProvisioner

func NewEnvironProvisioner(st *apiprovisioner.State, agentConfig agent.Config) Provisioner

NewEnvironProvisioner returns a new Provisioner for an environment. When new machines are added to the state, it allocates instances from the environment and allocates them to the new machines.

type ProvisionerTask

type ProvisionerTask interface {
	worker.Worker
	Stop() error
	Dying() <-chan struct{}
	Err() error

	// SetHarvestMode sets a flag to indicate how the provisioner task
	// should harvest machines. See config.HarvestMode for
	// documentation of behavior.
	SetHarvestMode(mode config.HarvestMode)
}

func NewProvisionerTask

func NewProvisionerTask(
	machineTag names.MachineTag,
	harvestMode config.HarvestMode,
	machineGetter MachineGetter,
	toolsFinder ToolsFinder,
	machineWatcher apiwatcher.StringsWatcher,
	retryWatcher apiwatcher.NotifyWatcher,
	broker environs.InstanceBroker,
	auth authentication.AuthenticationProvider,
	imageStream string,
	secureServerConnection bool,
) ProvisionerTask

type ToolsFinder

type ToolsFinder interface {
	// FindTools returns a list of tools matching the specified
	// version, series, and architecture. If arch is empty, the
	// implementation is expected to use a well documented default.
	FindTools(version version.Number, series string, arch string) (coretools.List, error)
}

ToolsFinder is an interface used for finding tools to run on provisioned instances.

Jump to

Keyboard shortcuts

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