Documentation ¶
Overview ¶
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2021 Red Hat, Inc. *
Index ¶
- Constants
- func AddCloudInitConfigDriveData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, ...)deprecated
- func AddCloudInitNoCloudData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, ...)deprecated
- func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, image string) *v1.VirtualMachineInstancedeprecated
- func AddUserData(vmi *v1.VirtualMachineInstance, name string, userData string)deprecated
- func ArchiveToFile(tgtFile *os.File, sourceFilesNames ...string)
- func ChangeImgFilePermissionsToNonQEMU(pvc *k8sv1.PersistentVolumeClaim)
- func CheckCloudInitMetaData(vmi *v1.VirtualMachineInstance, testFile, testData string)
- func CreateErrorDisk(nodeName string) (address string, device string)
- func CreateFaultyDisk(nodeName, deviceName string)
- func CreatePVandPVCwithFaultyDisk(nodeName, devicePath, namespace string) (*corev1.PersistentVolume, *corev1.PersistentVolumeClaim, error)
- func CreatePVandPVCwithSCSIDisk(nodeName, devicePath, namespace, storageClass, pvName, pvcName string) (*corev1.PersistentVolume, *corev1.PersistentVolumeClaim, error)
- func CreatePVwithSCSIDisk(storageClass, pvName, nodeName, devicePath string) (*corev1.PersistentVolume, error)
- func CreatePodAndWaitUntil(pod *corev1.Pod, phaseToWait corev1.PodPhase) *corev1.Pod
- func CreateSCSIDisk(nodeName string, opts []string) (address string, device string)
- func DisableFeatureGate(feature string)
- func EnableFeatureGate(feature string) *v1.KubeVirt
- func EnsurePodsCertIsSynced(labelSelector string, namespace string, port string) []byte
- func ExecuteCommandInVirtHandlerPod(nodeName string, args []string) (stdout string, err error)
- func ExpectResourceVersionToBeLessEqualThanConfigVersion(resourceVersion, configVersion string) bool
- func FixErrorDevice(nodeName string)
- func GenerateVMJson(vm *v1.VirtualMachine, generateDirectory string) (string, error)
- func GetBundleFromConfigMap(configMapName string) ([]byte, []*x509.Certificate)
- func GetRunningVMIDomainSpec(vmi *v1.VirtualMachineInstance) (*launcherApi.DomainSpec, error)
- func GetRunningVMIEmulator(vmi *v1.VirtualMachineInstance) (string, error)
- func GetRunningVirtualMachineInstanceDomainXML(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (string, error)
- func GetVmPodName(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) string
- func MountCloudInitFunc(devName string) func(*v1.VirtualMachineInstance)
- func NewHTTPServerPod(ipFamily, port int) *corev1.Pod
- func NewRandomReplicaSetFromVMI(vmi *v1.VirtualMachineInstance, replicas int32) *v1.VirtualMachineInstanceReplicaSet
- func NewRandomVMIWithEphemeralDisk(containerImage string) *v1.VirtualMachineInstancedeprecated
- func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdata(containerImage string, userData string) *v1.VirtualMachineInstancedeprecated
- func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *v1.VirtualMachineInstancedeprecated
- func NewRandomVMIWithEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstancedeprecated
- func NewRandomVMWithDataVolumeWithRegistryImport(imageUrl, namespace, storageClass string, ...) *v1.VirtualMachinedeprecated
- func NewRandomVirtualMachineInstanceWithBlockDisk(imageUrl, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)deprecated
- func NewRandomVirtualMachineInstanceWithDisk(imageUrl, namespace, sc string, accessMode k8sv1.PersistentVolumeAccessMode, ...) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)deprecated
- func NewTCPServerPod(ipFamily, port int) *corev1.Pod
- func NodeNameWithHandler() string
- func RandTmpDir() string
- func RemoveFaultyDisk(nodeName, deviceName string)
- func RemoveHostDiskImage(diskPath string, nodeName string)
- func RemoveSCSIDisk(nodeName, address string)
- func RetryIfModified(do func() error) (err error)
- func RetryWithMetadataIfModified(objectMeta metav1.ObjectMeta, do func(objectMeta metav1.ObjectMeta) error) (err error)
- func RunCommandOnVmiPod(vmi *v1.VirtualMachineInstance, command []string) string
- func RunPod(pod *k8sv1.Pod) *k8sv1.Pod
- func RunPodInNamespace(pod *k8sv1.Pod, namespace string) *k8sv1.Pod
- func RunVMAndExpectLaunchWithRunStrategy(virtClient kubecli.KubevirtClient, vm *v1.VirtualMachine, ...) *v1.VirtualMachine
- func RunVMIAndExpectLaunch(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
- func RunVMIAndExpectLaunchIgnoreWarnings(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
- func RunVMIAndExpectLaunchWithDataVolume(vmi *v1.VirtualMachineInstance, dv *cdiv1.DataVolume, timeout int) *v1.VirtualMachineInstance
- func RunVMIAndExpectScheduling(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
- func RunVMIAndExpectSchedulingWithWarningPolicy(vmi *v1.VirtualMachineInstance, timeout int, wp watcher.WarningsPolicy) *v1.VirtualMachineInstance
- func StartHTTPServerPod(ipFamily, port int) *corev1.Pod
- func StartTCPServerPod(ipFamily, port int) *corev1.Pod
- func StartVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
- func StopVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
- func StopVirtualMachineWithTimeout(vm *v1.VirtualMachine, timeout time.Duration) *v1.VirtualMachine
- func UnfinishedVMIPodSelector(vmi *v1.VirtualMachineInstance) metav1.ListOptions
- func UpdateKubeVirtConfigValueAndWait(kvConfig v1.KubeVirtConfiguration) *v1.KubeVirt
- func WaitForConfigToBePropagatedToComponent(podLabel string, resourceVersion string, compareResourceVersions compare, ...)
Constants ¶
const ( UsrBinVirtChroot = "/usr/bin/virt-chroot" Mount = "--mount" Proc1NsMnt = "/proc/1/ns/mnt" )
const ( BinBash = "/bin/bash" EchoLastReturnValue = "echo $?\n" CustomHostPath = "custom-host-path" DiskAlpineHostPath = "disk-alpine-host-path" DiskWindowsSysprep = "disk-windows-sysprep" DiskCustomHostPath = "disk-custom-host-path" )
Variables ¶
This section is empty.
Functions ¶
func AddCloudInitConfigDriveData
deprecated
added in
v0.19.0
func AddCloudInitConfigDriveData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, b64encode bool)
AddCloudInitConfigDriveData
Deprecated: Use libvmi
func AddCloudInitNoCloudData
deprecated
added in
v0.19.0
func AddCloudInitNoCloudData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, b64encode bool)
AddCloudInitNoCloudData
Deprecated: Use libvmi
func AddEphemeralDisk
deprecated
added in
v0.3.0
func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, image string) *v1.VirtualMachineInstance
AddEphemeralDisk
Deprecated: Use libvmi
func AddUserData
deprecated
added in
v0.9.0
func AddUserData(vmi *v1.VirtualMachineInstance, name string, userData string)
AddUserData
Deprecated: Use libvmi
func ArchiveToFile ¶ added in v0.51.0
func ChangeImgFilePermissionsToNonQEMU ¶ added in v0.53.0
func ChangeImgFilePermissionsToNonQEMU(pvc *k8sv1.PersistentVolumeClaim)
func CheckCloudInitMetaData ¶ added in v0.46.0
func CheckCloudInitMetaData(vmi *v1.VirtualMachineInstance, testFile, testData string)
func CreateErrorDisk ¶ added in v0.44.1
The tests using the function CreateErrorDisk need to be run serially as it relies on the kernel scsi_debug module
func CreateFaultyDisk ¶ added in v0.41.1
func CreateFaultyDisk(nodeName, deviceName string)
func CreatePVandPVCwithFaultyDisk ¶ added in v0.41.1
func CreatePVandPVCwithFaultyDisk(nodeName, devicePath, namespace string) (*corev1.PersistentVolume, *corev1.PersistentVolumeClaim, error)
func CreatePVandPVCwithSCSIDisk ¶ added in v0.48.0
func CreatePVandPVCwithSCSIDisk(nodeName, devicePath, namespace, storageClass, pvName, pvcName string) (*corev1.PersistentVolume, *corev1.PersistentVolumeClaim, error)
func CreatePVwithSCSIDisk ¶ added in v0.59.2
func CreatePVwithSCSIDisk(storageClass, pvName, nodeName, devicePath string) (*corev1.PersistentVolume, error)
func CreatePodAndWaitUntil ¶ added in v0.34.0
func CreateSCSIDisk ¶ added in v0.48.0
CreateSCSIDisk creates a SCSI disk using the scsi_debug module. This function should be used only to check SCSI disk functionalities and not for creating a filesystem or any data. The disk is stored in ram and it isn't suitable for storing large amount of data. If a test uses this function, it needs to be run serially. The device is created directly on the node and the addition and removal of the scsi_debug kernel module could create flakiness
func DisableFeatureGate ¶ added in v0.20.0
func DisableFeatureGate(feature string)
func EnableFeatureGate ¶ added in v0.20.0
func EnsurePodsCertIsSynced ¶ added in v0.29.0
EnsurePodsCertIsSynced waits until new certificates are rolled out to all pods which are matching the specified labelselector. Once all certificates are in sync, the final secret is returned
func ExecuteCommandInVirtHandlerPod ¶ added in v0.41.1
func ExpectResourceVersionToBeLessEqualThanConfigVersion ¶ added in v0.52.0
func FixErrorDevice ¶ added in v0.44.1
func FixErrorDevice(nodeName string)
func GenerateVMJson ¶ added in v0.17.0
func GenerateVMJson(vm *v1.VirtualMachine, generateDirectory string) (string, error)
func GetBundleFromConfigMap ¶ added in v0.29.0
func GetBundleFromConfigMap(configMapName string) ([]byte, []*x509.Certificate)
func GetRunningVMIDomainSpec ¶ added in v0.28.0
func GetRunningVMIDomainSpec(vmi *v1.VirtualMachineInstance) (*launcherApi.DomainSpec, error)
func GetRunningVMIEmulator ¶ added in v1.1.0
func GetRunningVMIEmulator(vmi *v1.VirtualMachineInstance) (string, error)
func GetRunningVirtualMachineInstanceDomainXML ¶ added in v0.9.2
func GetRunningVirtualMachineInstanceDomainXML(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (string, error)
func GetVmPodName ¶ added in v0.15.0
func GetVmPodName(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) string
func MountCloudInitFunc ¶ added in v0.46.0
func MountCloudInitFunc(devName string) func(*v1.VirtualMachineInstance)
func NewHTTPServerPod ¶ added in v0.34.0
func NewRandomReplicaSetFromVMI ¶ added in v0.6.1
func NewRandomReplicaSetFromVMI(vmi *v1.VirtualMachineInstance, replicas int32) *v1.VirtualMachineInstanceReplicaSet
func NewRandomVMIWithEphemeralDisk
deprecated
added in
v0.6.1
func NewRandomVMIWithEphemeralDisk(containerImage string) *v1.VirtualMachineInstance
NewRandomVMIWithEphemeralDisk
Deprecated: Use libvmi directly
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdata
deprecated
added in
v0.19.0
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
NewRandomVMIWithEphemeralDiskAndConfigDriveUserdata
Deprecated: Use libvmi directly
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataNetworkData
deprecated
added in
v0.19.0
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *v1.VirtualMachineInstance
NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataNetworkData
Deprecated: Use libvmi directly
func NewRandomVMIWithEphemeralDiskAndUserdata
deprecated
added in
v0.6.1
func NewRandomVMIWithEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
NewRandomVMIWithEphemeralDiskAndUserdata
Deprecated: Use libvmi directly
func NewRandomVMWithDataVolumeWithRegistryImport
deprecated
added in
v0.44.2
func NewRandomVMWithDataVolumeWithRegistryImport(imageUrl, namespace, storageClass string, accessMode k8sv1.PersistentVolumeAccessMode) *v1.VirtualMachine
NewRandomVMWithDataVolumeWithRegistryImport
Deprecated: Use libvmi directly
func NewRandomVirtualMachineInstanceWithBlockDisk
deprecated
added in
v0.49.1
func NewRandomVirtualMachineInstanceWithBlockDisk(imageUrl, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
NewRandomVirtualMachineInstanceWithBlockDisk
Deprecated: Use libvmi directly
func NewRandomVirtualMachineInstanceWithDisk
deprecated
added in
v0.49.1
func NewRandomVirtualMachineInstanceWithDisk(imageUrl, namespace, sc string, accessMode k8sv1.PersistentVolumeAccessMode, volMode k8sv1.PersistentVolumeMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
NewRandomVirtualMachineInstanceWithDisk
Deprecated: Use libvmi directly
func NewTCPServerPod ¶ added in v0.34.0
func NodeNameWithHandler ¶ added in v0.41.1
func NodeNameWithHandler() string
func RandTmpDir ¶ added in v0.29.0
func RandTmpDir() string
func RemoveFaultyDisk ¶ added in v0.41.1
func RemoveFaultyDisk(nodeName, deviceName string)
func RemoveHostDiskImage ¶ added in v0.9.0
func RemoveSCSIDisk ¶ added in v0.48.0
func RemoveSCSIDisk(nodeName, address string)
func RetryIfModified ¶ added in v0.22.0
func RetryWithMetadataIfModified ¶ added in v0.23.0
func RetryWithMetadataIfModified(objectMeta metav1.ObjectMeta, do func(objectMeta metav1.ObjectMeta) error) (err error)
func RunCommandOnVmiPod ¶ added in v0.6.3
func RunCommandOnVmiPod(vmi *v1.VirtualMachineInstance, command []string) string
RunCommandOnVmiPod runs specified command on the virt-launcher pod
func RunPodInNamespace ¶ added in v0.58.0
func RunVMAndExpectLaunchWithRunStrategy ¶ added in v1.3.0
func RunVMAndExpectLaunchWithRunStrategy(virtClient kubecli.KubevirtClient, vm *v1.VirtualMachine, runStrategy v1.VirtualMachineRunStrategy) *v1.VirtualMachine
func RunVMIAndExpectLaunch ¶ added in v0.9.0
func RunVMIAndExpectLaunch(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
func RunVMIAndExpectLaunchIgnoreWarnings ¶ added in v0.29.0
func RunVMIAndExpectLaunchIgnoreWarnings(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
func RunVMIAndExpectLaunchWithDataVolume ¶ added in v0.40.0
func RunVMIAndExpectLaunchWithDataVolume(vmi *v1.VirtualMachineInstance, dv *cdiv1.DataVolume, timeout int) *v1.VirtualMachineInstance
func RunVMIAndExpectScheduling ¶ added in v0.17.0
func RunVMIAndExpectScheduling(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
func RunVMIAndExpectSchedulingWithWarningPolicy ¶ added in v0.58.1
func RunVMIAndExpectSchedulingWithWarningPolicy(vmi *v1.VirtualMachineInstance, timeout int, wp watcher.WarningsPolicy) *v1.VirtualMachineInstance
func StartHTTPServerPod ¶ added in v0.34.0
func StartTCPServerPod ¶ added in v0.34.0
func StartVirtualMachine ¶ added in v0.8.0
func StartVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
func StopVirtualMachine ¶ added in v0.8.0
func StopVirtualMachine(vm *v1.VirtualMachine) *v1.VirtualMachine
func StopVirtualMachineWithTimeout ¶ added in v0.41.0
func StopVirtualMachineWithTimeout(vm *v1.VirtualMachine, timeout time.Duration) *v1.VirtualMachine
func UnfinishedVMIPodSelector ¶ added in v0.6.1
func UnfinishedVMIPodSelector(vmi *v1.VirtualMachineInstance) metav1.ListOptions
func UpdateKubeVirtConfigValueAndWait ¶ added in v0.35.0
func UpdateKubeVirtConfigValueAndWait(kvConfig v1.KubeVirtConfiguration) *v1.KubeVirt
UpdateKubeVirtConfigValueAndWait updates the given configuration in the kubevirt custom resource and then waits to allow the configuration events to be propagated to the consumers.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
framework
|
|
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |