cloudinit

package
v0.59.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 18 Imported by: 20

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func GenerateEmptyIso added in v0.36.4

func GenerateEmptyIso(vmiName string, namespace string, data *CloudInitData, size int64) error

func GenerateLocalData

func GenerateLocalData(vmi *v1.VirtualMachineInstance, instanceType 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 PrepareLocalPath added in v0.44.1

func PrepareLocalPath(vmiName string, namespace string) error

func SetIsoCreationFunction

func SetIsoCreationFunction(isoFunc IsoCreationFunc)

The unit test suite uses this function

func SetLocalDirectory

func SetLocalDirectory(dir string) error

func SetLocalDirectoryOnly added in v0.41.4

func SetLocalDirectoryOnly(dir string)

XXX refactor this whole package This is just a cheap workaround to make e2e tests pass

Types

type CloudInitData added in v0.19.0

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

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 {
	InstanceType  string            `json:"instance_type,omitempty"`
	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"`
	NumaNode    uint32             `json:"numaNode,omitempty"`
	AlignedCPUs []uint32           `json:"alignedCPUs,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 {
	InstanceType  string `json:"instance-type,omitempty"`
	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