containerinit

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudInitUserData

func CloudInitUserData(
	instanceConfig *instancecfg.InstanceConfig,
	networkConfig *container.NetworkConfig,
) ([]byte, error)

func GenerateNetworkConfig

func GenerateNetworkConfig(networkConfig *container.NetworkConfig) (string, error)

GenerateNetworkConfig renders a network config for one or more network interfaces, using the given non-nil networkConfig containing a non-empty Interfaces field.

func TemplateUserData

func TemplateUserData(
	series string,
	authorizedKeys string,
	aptProxy proxy.Settings,
	aptMirror string,
	enablePackageUpdates bool,
	enableOSUpgrades bool,
	networkConfig *container.NetworkConfig,
) ([]byte, error)

TemplateUserData returns a minimal user data necessary for the template. This should have the authorized keys, base packages, the cloud archive if necessary, initial apt proxy config, and it should do the apt-get update/upgrade initially.

func WriteCloudInitFile

func WriteCloudInitFile(directory string, userData []byte) (string, error)

WriteCloudInitFile writes the data out to a cloud-init file in the directory specified, and returns the filename.

func WriteUserData

func WriteUserData(
	instanceConfig *instancecfg.InstanceConfig,
	networkConfig *container.NetworkConfig,
	directory string,
) (string, error)

WriteUserData generates the cloud-init user-data using the specified machine and network config for a container, and writes the serialized form out to a cloud-init file in the directory specified.

Types

type PreparedConfig

type PreparedConfig struct {
	InterfaceNames   []string
	AutoStarted      []string
	DNSServers       []string
	DNSSearchDomains []string
	NameToAddress    map[string]string
	NameToRoutes     map[string][]network.Route
	GatewayAddress   string
}

PreparedConfig holds all the necessary information to render a persistent network config to a file.

func PrepareNetworkConfigFromInterfaces

func PrepareNetworkConfigFromInterfaces(interfaces []network.InterfaceInfo) *PreparedConfig

PrepareNetworkConfigFromInterfaces collects the necessary information to render a persistent network config from the given slice of network.InterfaceInfo. The result always includes the loopback interface.

Jump to

Keyboard shortcuts

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