Documentation ¶
Index ¶
- Constants
- Variables
- func NewContainerSetupHandler(params ContainerSetupParams) worker.StringsWatchHandler
- func NewKvmBroker(api APICalls, agentConfig agent.Config, managerConfig container.ManagerConfig, ...) (environs.InstanceBroker, error)
- type APICalls
- type ContainerSetup
- type ContainerSetupParams
- type IptablesRule
- type MachineGetter
- type Provisioner
- type ProvisionerTask
- type ToolsFinder
Constants ¶
const MACAddressTemplate = "00:16:3e:xx:xx:xx"
MACAddressTemplate is used to generate a unique MAC address for a container. Every 'x' is replaced by a random hexadecimal digit, while the rest is kept as-is.
Variables ¶
var NewLxcBroker = newLxcBroker
Override for testing.
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 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 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 and series, and optionally arch. FindTools(version version.Number, series string, arch *string) (coretools.List, error) }
ToolsFinder is an interface used for finding tools to run on provisioned instances.