cloudinit

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 16 Imported by: 20

Documentation

Index

Constants

View Source
const (
	DataSourceNoCloud     DataSourceType     = "noCloud"
	DataSourceConfigDrive DataSourceType     = "configDrive"
	NICMetadataType       DeviceMetadataType = "nic"
)

Variables

This section is empty.

Functions

func GenerateLocalData

func GenerateLocalData(vmiName string, namespace string, data *CloudInitData) error

func GetIsoFilePath added in v0.19.0

func GetIsoFilePath(source DataSourceType, domain, namespace string) string

func IsValidCloudInitData added in v0.19.0

func IsValidCloudInitData(cloudInitData *CloudInitData) bool

IsValidCloudInitData checks if the given CloudInitData object is valid in the sense that GenerateLocalData can be called with it.

func SetIsoCreationFunction

func SetIsoCreationFunction(isoFunc IsoCreationFunc)

The unit test suite uses this function

func SetLocalDirectory

func SetLocalDirectory(dir string) error

Types

type CloudInitData added in v0.19.0

type CloudInitData struct {
	DataSource          DataSourceType
	NoCloudMetaData     *NoCloudMetadata
	ConfigDriveMetaData *ConfigDriveMetadata
	UserData            string
	NetworkData         string
	DevicesData         *[]DeviceData
}

CloudInitData is a data source independent struct that holds cloud-init user and network data

func ReadCloudInitVolumeDataSource added in v0.19.0

func ReadCloudInitVolumeDataSource(vmi *v1.VirtualMachineInstance, secretSourceDir string) (cloudInitData *CloudInitData, err error)

ReadCloudInitVolumeDataSource scans the given VMI for CloudInit volumes and reads their content into a CloudInitData struct. Does not resolve secret refs.

type ConfigDriveMetadata added in v0.36.0

type ConfigDriveMetadata struct {
	InstanceID    string            `json:"instance_id"`
	LocalHostname string            `json:"local_hostname,omitempty"`
	Hostname      string            `json:"hostname,omitempty"`
	UUID          string            `json:"uuid,omitempty"`
	Devices       *[]DeviceData     `json:"devices,omitempty"`
	PublicSSHKeys map[string]string `json:"public_keys,omitempty"`
}

type DataSourceType added in v0.19.0

type DataSourceType string

type DeviceData added in v0.28.0

type DeviceData struct {
	Type    DeviceMetadataType `json:"type"`
	Bus     string             `json:"bus"`
	Address string             `json:"address"`
	MAC     string             `json:"mac,omitempty"`
	Serial  string             `json:"serial,omitempty"`
	Tags    []string           `json:"tags"`
}

type DeviceMetadataType added in v0.28.0

type DeviceMetadataType string

type IsoCreationFunc

type IsoCreationFunc func(isoOutFile, volumeID string, inDir string) error

type NoCloudMetadata added in v0.36.0

type NoCloudMetadata struct {
	InstanceID    string `json:"instance-id"`
	LocalHostname string `json:"local-hostname,omitempty"`
}

type PublicSSHKey added in v0.36.0

type PublicSSHKey struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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