Documentation ¶
Index ¶
- func CloudInitUserData(instanceConfig *instancecfg.InstanceConfig, ...) ([]byte, error)
- func GenerateNetworkConfig(networkConfig *container.NetworkConfig) (string, error)
- func TemplateUserData(series string, authorizedKeys string, aptProxy proxy.Settings, ...) ([]byte, error)
- func WriteCloudInitFile(directory string, userData []byte) (string, error)
- func WriteUserData(instanceConfig *instancecfg.InstanceConfig, ...) (string, error)
- type PreparedConfig
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 ¶
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.