Documentation ¶
Index ¶
- Constants
- Variables
- func AcquireTemplateLock(name, message string) (*container.Lock, error)
- func DefaultNetworkConfig() *container.NetworkConfig
- func EnsureCloneTemplate(backingFilesystem string, series string, ...) (golxc.Container, error)
- func IsLXCSupported() (bool, error)
- func NewContainerInitialiser(series string) container.Initialiser
- func NewContainerManager(conf container.ManagerConfig, imageURLGetter container.ImageURLGetter) (container.Manager, error)
Constants ¶
const ( // DefaultLxcBridge is the package created container bridge DefaultLxcBridge = "lxcbr0" // Btrfs is special as we treat it differently for create and clone. Btrfs = "btrfs" )
Variables ¶
var ( TemplateLockDir = "/var/lib/juju/locks" TemplateStopTimeout = 5 * time.Minute )
var ( LxcContainerDir = golxc.GetDefaultLXCContainerDir() LxcRestartDir = "/etc/lxc/auto" LxcObjectFactory = golxc.Factory() )
var FsCommandOutput = (*exec.Cmd).CombinedOutput
FsCommandOutput calls cmd.Output, this is used as an overloading point so we can test what *would* be run without actually executing another program
Functions ¶
func DefaultNetworkConfig ¶
func DefaultNetworkConfig() *container.NetworkConfig
DefaultNetworkConfig returns a valid NetworkConfig to use the defaultLxcBridge that is created by the lxc package.
func EnsureCloneTemplate ¶
func EnsureCloneTemplate( backingFilesystem string, series string, networkConfig *container.NetworkConfig, authorizedKeys string, aptProxy proxy.Settings, aptMirror string, enablePackageUpdates bool, enableOSUpgrades bool, imageURLGetter container.ImageURLGetter, ) (golxc.Container, error)
Make sure a template exists that we can clone from.
func IsLXCSupported ¶
IsLXCSupported returns a boolean value indicating whether or not we can run LXC containers
func NewContainerInitialiser ¶
func NewContainerInitialiser(series string) container.Initialiser
NewContainerInitialiser returns an instance used to perform the steps required to allow a host machine to run a LXC container.
func NewContainerManager ¶
func NewContainerManager(conf container.ManagerConfig, imageURLGetter container.ImageURLGetter) (container.Manager, error)
NewContainerManager returns a manager object that can start and stop lxc containers. The containers that are created are namespaced by the name parameter inside the given ManagerConfig.
Types ¶
This section is empty.