Documentation ¶
Index ¶
- Constants
- func AddFinalizer(cr *v2vv1.VirtualMachineImport, name string, client rclient.Client) error
- func AppendMap(origin map[string]string, newMap map[string]string)
- func CountImportedDataVolumes(dvsDone map[string]bool) int
- func EnsureLabelValueLength(value string) string
- func FoldCleanUpErrors(errs []error, vmiName k8stypes.NamespacedName) error
- func FormatBytes(bytes int64) (string, error)
- func GetMapKeys(theMap map[string]string) []string
- func GetOverheadForStorageClass(filesystemOverhead cdiv1.FilesystemOverhead, storageClass *string) float64
- func HasFinalizer(cr *v2vv1.VirtualMachineImport, name string) bool
- func IndexNetworkByIDAndName(mapping *[]v2vv1.NetworkResourceMappingItem) (mapByID map[string]v2vv1.NetworkResourceMappingItem, ...)
- func IndexStorageItemByIDAndName(mapping *[]v2vv1.StorageResourceMappingItem) (mapByID map[string]v2vv1.StorageResourceMappingItem, ...)
- func IsUtcCompatible(timezone string) bool
- func NormalizeLabel(name string) (string, error)
- func NormalizeName(name string) (string, error)
- func ParseUtcOffsetToSeconds(offset string) (int, error)
- func RemoveFinalizer(cr *v2vv1.VirtualMachineImport, name string, client rclient.Client) error
- func RoundUp(number, multiple int64) int64
- func ToLoggableID(id *string, name *string) string
- func ToLoggableResourceName(name string, namespace *string) string
- func UpdateAnnotations(vm *v1.VirtualMachine, annotationMap map[string]string)
- func UpdateLabels(vm *v1.VirtualMachine, labels map[string]string)
- func WithMessage(message string, newMessage string) string
Constants ¶
const ( // RestoreVMStateFinalizer defines restore source vm finalizer RestoreVMStateFinalizer = "vmimport.v2v.kubevirt.io/restore-state" // CleanupSnapshotsFinalizer defines a finalizer to remove warm import snapshots CleanupSnapshotsFinalizer = "vmimport.v2v.kubevirt.io/cleanup-snapshots" // Finalaizer for handling cancelled import CancelledImportFinalizer = "vmimport.v2v.kubevirt.io/cancelled-import" )
Variables ¶
This section is empty.
Functions ¶
func AddFinalizer ¶ added in v0.2.0
AddFinalizer adds finalizer to VM import CR
func CountImportedDataVolumes ¶
CountImportedDataVolumes return number of true values in map of booleans
func EnsureLabelValueLength ¶ added in v0.2.0
EnsureLabelValueLength shortens given value to the maximum label value length of 63 characters
func FoldCleanUpErrors ¶ added in v0.2.2
func FoldCleanUpErrors(errs []error, vmiName k8stypes.NamespacedName) error
FoldCleanUpErrors combines clean up errors into one error
func FormatBytes ¶
FormatBytes convert bytes to highest suffix
func GetMapKeys ¶
GetMapKeys gets all keys from a map as a slice
func GetOverheadForStorageClass ¶ added in v0.3.1
func GetOverheadForStorageClass(filesystemOverhead cdiv1.FilesystemOverhead, storageClass *string) float64
func HasFinalizer ¶ added in v0.2.0
func HasFinalizer(cr *v2vv1.VirtualMachineImport, name string) bool
HasFinalizer checks whether specific finalizer is set on VM import CR
func IndexNetworkByIDAndName ¶ added in v0.2.0
func IndexNetworkByIDAndName(mapping *[]v2vv1.NetworkResourceMappingItem) (mapByID map[string]v2vv1.NetworkResourceMappingItem, mapByName map[string]v2vv1.NetworkResourceMappingItem)
IndexNetworkByIDAndName indexes mapping array by ID and by Name
func IndexStorageItemByIDAndName ¶ added in v0.2.0
func IndexStorageItemByIDAndName(mapping *[]v2vv1.StorageResourceMappingItem) (mapByID map[string]v2vv1.StorageResourceMappingItem, mapByName map[string]v2vv1.StorageResourceMappingItem)
IndexStorageItemByIDAndName indexes mapping array by ID and by Name
func IsUtcCompatible ¶
IsUtcCompatible checks whether given timezone behaves like UTC - has the same offset of 0 and does not observer daylight saving time
func NormalizeLabel ¶ added in v0.2.4
NormalizeLabel returns a normalized label based on the given name that complies to DNS 1123 format
func NormalizeName ¶
NormalizeName returns a normalized name based on the given name that complies to DNS 1123 format
func ParseUtcOffsetToSeconds ¶
ParseUtcOffsetToSeconds parses UTC offset string ([+|-]HH:MM) into representation in seconds. Only syntactical validation is performed on input string.
func RemoveFinalizer ¶ added in v0.2.0
RemoveFinalizer removes specific finalizer from VM import CR
func ToLoggableID ¶
ToLoggableID creates loggable identifier that may be comprised of an id and/or a name
func ToLoggableResourceName ¶
ToLoggableResourceName creates loggable representation of maybe namespaced resource name
func UpdateAnnotations ¶ added in v0.2.2
func UpdateAnnotations(vm *v1.VirtualMachine, annotationMap map[string]string)
UpdateAnnotations updates a VirtualMachine's annotations with values from a provided map, overwriting any duplicates
func UpdateLabels ¶ added in v0.2.2
func UpdateLabels(vm *v1.VirtualMachine, labels map[string]string)
UpdateLabels updates a VirtualMachine's labels with values from a provided map, overwriting any duplicates
func WithMessage ¶
WithMessage joins message and newMessage with a ", " string and returns the resulting string or returns newMessage if message is empty
Types ¶
This section is empty.