Documentation ¶
Index ¶
- Constants
- func GenerateLocalData(vmiName string, namespace string, data *CloudInitData) error
- func GetIsoFilePath(source DataSourceType, domain, namespace string) string
- func IsValidCloudInitData(cloudInitData *CloudInitData) bool
- func ResolveConfigDriveSecrets(vmi *v1.VirtualMachineInstance, secretSourceDir string) error
- func ResolveNoCloudSecrets(vmi *v1.VirtualMachineInstance, secretSourceDir string) error
- func SetIsoCreationFunction(isoFunc IsoCreationFunc)
- func SetLocalDirectory(dir string) error
- type CloudInitData
- type DataSourceType
- type DeviceData
- type DeviceMetadataType
- type IsoCreationFunc
- type Metadata
Constants ¶
const ( DataSourceNoCloud DataSourceType = "noCloud" DataSourceConfigDrive DataSourceType = "configDrive" NICMetadataType DeviceMetadataType = "nic" DiskMetadataType DeviceMetadataType = "disk" )
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 ResolveConfigDriveSecrets ¶ added in v0.26.0
func ResolveConfigDriveSecrets(vmi *v1.VirtualMachineInstance, secretSourceDir string) error
ResolveConfigDriveSecrets is looking for CloudInitConfigDriveSource volume source with UserDataSecretRef and NetworkDataSecretRef and resolves the secret from the corresponding VolumeMount.
Note: when using this function, make sure that your code can access the secret volumes.
func ResolveNoCloudSecrets ¶ added in v0.26.0
func ResolveNoCloudSecrets(vmi *v1.VirtualMachineInstance, secretSourceDir string) error
ResolveNoCloudSecrets is looking for CloudInitNoCloud volumes with UserDataSecretRef requests. It reads the `userdata` secret the corresponds to the given CloudInitNoCloud volume and sets the UserData field on that volume.
Note: when using this function, make sure that your code can access the secret volumes.
func SetIsoCreationFunction ¶
func SetIsoCreationFunction(isoFunc IsoCreationFunc)
The unit test suite uses this function
func SetLocalDirectory ¶
Types ¶
type CloudInitData ¶ added in v0.19.0
type CloudInitData struct { DataSource DataSourceType MetaData *Metadata 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) (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. To ensure that secrets are read correctly, call ResolveNoCloudSecrets beforehand.
type DataSourceType ¶ added in v0.19.0
type DataSourceType string
type DeviceData ¶ added in v0.28.0
type DeviceMetadataType ¶ added in v0.28.0
type DeviceMetadataType string