mapper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// LabelOrigin define name of the label which holds value of origin attribute of oVirt VM
	LabelOrigin = "origin"
	// LabelInstanceType define name of the label which holds value of instance type attribute of oVirt VM
	LabelInstanceType = "instanceType"
	// LabelTag define name of the label which holds tags of oVirt VM
	LabelTag = "tags"
	// AnnotationComment define name of the annotation which holds comment of oVirt VM
	AnnotationComment = "comment"
	// AnnotationSso define name of the annotation which holds sso method of oVirt VM
	AnnotationSso = "sso"
	// DefaultStorageClassTargetName define the storage target name value that forces using default storage class
	DefaultStorageClassTargetName = ""
	// CustomFlavorLabel define lable when when template not found
	CustomFlavorLabel = "flavor.template.kubevirt.io/custom"
)

Variables

View Source
var BiosTypeMapping = map[string]*kubevirtv1.Bootloader{
	"q35_sea_bios":    &kubevirtv1.Bootloader{BIOS: &kubevirtv1.BIOS{}},
	"q35_secure_boot": &kubevirtv1.Bootloader{BIOS: &kubevirtv1.BIOS{}},
	"q35_ovmf":        &kubevirtv1.Bootloader{EFI: &kubevirtv1.EFI{}},
}

BiosTypeMapping defines mapping of BIOS types between oVirt and kubevirt domains

Functions

This section is empty.

Types

type DataVolumeCredentials

type DataVolumeCredentials struct {
	URL           string
	CACertificate string
	KeyAccess     string
	KeySecret     string
	ConfigMapName string
	SecretName    string
}

DataVolumeCredentials defines the credentials required for creating a data volume

type OvirtMapper

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

OvirtMapper is struct that holds attributes needed to map oVirt VM to kubevirt VM

func NewOvirtMapper

func NewOvirtMapper(vm *ovirtsdk.Vm, mappings *v2vv1alpha1.OvirtMappings, creds DataVolumeCredentials, namespace string, osFinder oos.OSFinder) *OvirtMapper

NewOvirtMapper create ovirt mapper object

func (*OvirtMapper) CreateEmptyVM

func (o *OvirtMapper) CreateEmptyVM(vmName *string) *kubevirtv1.VirtualMachine

CreateEmptyVM creates empty virtual machine definition

func (*OvirtMapper) MapDataVolumes

func (o *OvirtMapper) MapDataVolumes() (map[string]cdiv1.DataVolume, error)

MapDataVolumes map the oVirt VM disks to the map of CDI DataVolumes specification, where map id is the id of the oVirt disk

func (*OvirtMapper) MapDisks

func (o *OvirtMapper) MapDisks(vmSpec *kubevirtv1.VirtualMachine, dvs map[string]cdiv1.DataVolume)

MapDisks map VM disks

func (*OvirtMapper) MapVM

func (o *OvirtMapper) MapVM(targetVMName *string, vmSpec *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)

MapVM map oVirt API VM definition to kubevirt VM definition

func (*OvirtMapper) ResolveVMName

func (o *OvirtMapper) ResolveVMName(targetVMName *string) *string

ResolveVMName resolves the target VM name

Jump to

Keyboard shortcuts

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