containerizer

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgePolicy

type BridgePolicy struct {
	// NetBondReconfigureDelay is how much of a delay to inject if we see that
	// one of the devices being bridged is a BondDevice. This exists because of
	// https://bugs.launchpad.net/juju/+bug/1657579
	NetBondReconfigureDelay int
	// UseLocalBridges decides if we should use local-only bridges ("lxdbr0", "virbr0"),
	// to handle unnamed space requests.
	UseLocalBridges bool
}

BridgePolicy defines functionality that helps us create and define bridges for guests inside of a host machine, along with the creation of network devices on those bridges for the containers to use. Ideally BridgePolicy would be defined outside of the 'state' package as it doesn't deal directly with DB content, but not quite enough of State is exposed

func (*BridgePolicy) FindMissingBridgesForContainer

func (b *BridgePolicy) FindMissingBridgesForContainer(m Machine, containerMachine Container) ([]network.DeviceToBridge, int, error)

FindMissingBridgesForContainer looks at the spaces that the container wants to be in, and sees if there are any host devices that should be bridged. This will return an Error if the container wants a space that the host machine cannot provide.

func (*BridgePolicy) PopulateContainerLinkLayerDevices

func (p *BridgePolicy) PopulateContainerLinkLayerDevices(m Machine, containerMachine Container) error

PopulateContainerLinkLayerDevices sets the link-layer devices of the given containerMachine, setting each device linked to the corresponding BridgeDevice of the host machine. It also records when one of the desired spaces is available on the host machine, but not currently bridged.

type Container

type Container interface {
	Machine
	ContainerType() instance.ContainerType
	DesiredSpaces() (set.Strings, error)
	SetLinkLayerDevices(...state.LinkLayerDeviceArgs) error
}

Container describes the extra attributes we need to be able to update the devices for a container. *state.Machine should fulfill the interface.

type Machine

type Machine interface {
	Id() string
	AllSpaces() (set.Strings, error)
	LinkLayerDevicesForSpaces([]string) (map[string][]*state.LinkLayerDevice, error)
}

Machine describes either a host machine, or a container machine. Either way *state.Machine should fulfill the interface in non-test code.

Jump to

Keyboard shortcuts

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