Documentation
¶
Index ¶
- Variables
- func NewContainerSetupHandler(runner worker.Runner, workerName string, ...) worker.StringsWatchHandler
- func NewKvmBroker(api APICalls, tools *tools.Tools, agentConfig agent.Config, ...) (environs.InstanceBroker, error)
- func NewLxcBroker(api APICalls, tools *tools.Tools, agentConfig agent.Config, ...) (environs.InstanceBroker, error)
- type APICalls
- type ContainerSetup
- type MachineGetter
- type Provisioner
- type ProvisionerTask
Constants ¶
This section is empty.
Variables ¶
var StartProvisioner = startProvisionerWorker
Override for testing.
Functions ¶
func NewContainerSetupHandler ¶
func NewContainerSetupHandler(runner worker.Runner, workerName string, supportedContainers []instance.ContainerType, machine *apiprovisioner.Machine, provisioner *apiprovisioner.State, config agent.Config, initLock *fslock.Lock) worker.StringsWatchHandler
NewContainerSetupHandler returns a StringsWatchHandler which is notified when containers are created on the given machine.
func NewKvmBroker ¶
func NewKvmBroker( api APICalls, tools *tools.Tools, agentConfig agent.Config, managerConfig container.ManagerConfig, ) (environs.InstanceBroker, error)
func NewLxcBroker ¶
func NewLxcBroker(api APICalls, tools *tools.Tools, agentConfig agent.Config, managerConfig container.ManagerConfig) (environs.InstanceBroker, error)
Types ¶
type APICalls ¶
type APICalls interface {
ContainerConfig() (params.ContainerConfig, error)
}
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 MachineGetter ¶
type MachineGetter interface { Machine(tag string) (*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) 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 // SetSafeMode sets a flag to indicate whether the provisioner task // runs in safe mode or not. In safe mode, any running instances // which do no exist in state are allowed to keep running rather than // being shut down. SetSafeMode(safeMode bool) }
func NewProvisionerTask ¶
func NewProvisionerTask( machineTag string, safeMode bool, machineGetter MachineGetter, machineWatcher apiwatcher.StringsWatcher, retryWatcher apiwatcher.NotifyWatcher, broker environs.InstanceBroker, auth environs.AuthenticationProvider, ) ProvisionerTask