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 AddBootOrderToDisk(vmi *v1.VirtualMachineInstance, diskName string, bootorder *uint) *v1.VirtualMachineInstance
- func AddCloudInitConfigDriveData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, ...)
- func AddCloudInitNoCloudData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, ...)
- func AddConfigMapDisk(vmi *v1.VirtualMachineInstance, configMapName string, volumeName string)
- func AddConfigMapDiskWithCustomLabel(vmi *v1.VirtualMachineInstance, configMapName string, volumeName string, ...)
- func AddEphemeralCdrom(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, image string) *v1.VirtualMachineInstance
- func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, image string) *v1.VirtualMachineInstance
- func AddExplicitPodNetworkInterface(vmi *v1.VirtualMachineInstance)
- func AddHostDisk(vmi *v1.VirtualMachineInstance, path string, diskType v1.HostDiskType, ...)
- func AddLabelDownwardAPIVolume(vmi *v1.VirtualMachineInstance, volumeName string)
- func AddPVCDisk(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, claimName string) *v1.VirtualMachineInstance
- func AddSecretDisk(vmi *v1.VirtualMachineInstance, secretName string, volumeName string)
- func AddSecretDiskWithCustomLabel(vmi *v1.VirtualMachineInstance, secretName string, volumeName string, ...)
- func AddServiceAccountDisk(vmi *v1.VirtualMachineInstance, serviceAccountName string)
- func AddUserData(vmi *v1.VirtualMachineInstance, name string, userData string)
- func AddWatchdog(vmi *v1.VirtualMachineInstance, action v1.WatchdogAction)
- func AppendEmptyDisk(vmi *v1.VirtualMachineInstance, diskName string, busName v1.DiskBus, ...)
- func ArchiveToFile(tgtFile *os.File, sourceFilesNames ...string)
- func ChangeImgFilePermissionsToNonQEMU(pvc *k8sv1.PersistentVolumeClaim)
- func CheckCloudInitMetaData(vmi *v1.VirtualMachineInstance, testFile, testData string)
- func CheckResultShellCommandOnVmi(vmi *v1.VirtualMachineInstance, cmd, output string, timeout int)
- func CopyAlpineWithNonQEMUPermissions() (dstPath, nodeName string)
- func CreateConfigMap(name, namespace string, data map[string]string)
- func CreateErrorDisk(nodeName string) (address string, device string)
- func CreateExecutorPodWithPVC(podName string, pvc *k8sv1.PersistentVolumeClaim) *k8sv1.Pod
- func CreateFaultyDisk(nodeName, deviceName string)
- func CreateHostDiskImage(diskPath string) *k8sv1.Pod
- 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 CreateSecret(name, namespace string, data map[string]string)
- func CreateVmiOnNode(vmi *v1.VirtualMachineInstance, nodeName string) *v1.VirtualMachineInstance
- func CreateVmiOnNodeLabeled(vmi *v1.VirtualMachineInstance, nodeLabel, labelValue string) *v1.VirtualMachineInstance
- func DeleteAlpineWithNonQEMUPermissions()
- func DeleteConfigMap(name, namespace string)
- func DeletePvAndPvc(name string)
- func DeleteSecret(name, namespace string)
- func DeprecatedBeforeAll(fn func())deprecated
- func DisableFeatureGate(feature string)
- func DryRunCreate(client *rest.RESTClient, resource, namespace string, obj interface{}, ...) error
- func DryRunPatch(client *rest.RESTClient, resource, name, namespace string, pt types.PatchType, ...) error
- func DryRunUpdate(client *rest.RESTClient, resource, name, namespace string, obj interface{}, ...) error
- func EnableFeatureGate(feature string) *v1.KubeVirt
- func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte
- func EnsurePodsCertIsSynced(labelSelector string, namespace string, port string) []byte
- func ExecuteCommandInVirtHandlerPod(nodeName string, args []string) (stdout string, err error)
- func ExecuteCommandOnNodeThroughVirtHandler(virtCli kubecli.KubevirtClient, nodeName string, command []string) (stdout string, stderr string, err error)
- func ExpectResourceVersionToBeLessEqualThanConfigVersion(resourceVersion, configVersion string) bool
- func FixErrorDevice(nodeName string)
- func ForwardPorts(pod *k8sv1.Pod, ports []string, stop chan struct{}, readyTimeout time.Duration) error
- func GenerateHelloWorldServer(vmi *v1.VirtualMachineInstance, testPort int, protocol string, ...)
- func GeneratePrivateKey(bitSize int) (*rsa.PrivateKey, error)
- func GeneratePublicKey(privatekey *rsa.PublicKey) ([]byte, error)
- func GenerateVMJson(vm *v1.VirtualMachine, generateDirectory string) (string, error)
- func GetBundleFromConfigMap(configMapName string) ([]byte, []*x509.Certificate)
- func GetCertFromSecret(secretName string) []byte
- func GetCertsForPods(labelSelector string, namespace string, port string) ([][]byte, error)
- func GetComputeContainerOfPod(pod *k8sv1.Pod) *k8sv1.Container
- func GetContainerOfPod(pod *k8sv1.Pod, containerName string) *k8sv1.Container
- func GetDefaultExportProxyDeployment(namespace string, config *util.KubeVirtDeploymentConfig) (*v12.Deployment, error)
- func GetDefaultVirtApiDeployment(namespace string, config *util.KubeVirtDeploymentConfig) (*v12.Deployment, error)
- func GetDefaultVirtControllerDeployment(namespace string, config *util.KubeVirtDeploymentConfig) (*v12.Deployment, error)
- func GetDefaultVirtHandlerDaemonSet(namespace string, config *util.KubeVirtDeploymentConfig) (*v12.DaemonSet, error)
- func GetFedoraToolsGuestAgentBlacklistUserData(commands string) string
- func GetIdOfLauncher(vmi *v1.VirtualMachineInstance) string
- func GetKubevirtVMMetricsFunc(virtClient *kubecli.KubevirtClient, pod *k8sv1.Pod) func(string) string
- func GetKvmPitMask(qemupid, nodeName string) (output string, err error)
- func GetNodeHostModel(node *k8sv1.Node) (hostModel string)
- func GetPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance) *k8sv1.Pod
- func GetPodCPUSet(pod *k8sv1.Pod) (output string, err error)
- func GetPodsCertIfSynced(labelSelector string, namespace string, port string) (cert []byte, synced bool, err error)
- func GetProcessName(pod *k8sv1.Pod, pid string) (output string, err error)
- func GetRunningPodByLabel(label string, labelType string, namespace string, node string) (*k8sv1.Pod, error)
- func GetRunningPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
- 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 GetSupportedCPUFeatures(nodes k8sv1.NodeList) []string
- func GetSupportedCPUModels(nodes k8sv1.NodeList) []string
- func GetVcpuMask(pod *k8sv1.Pod, emulator, cpu string) (output string, err error)
- func GetVmPodName(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) string
- func GetVmiPod(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) *k8sv1.Pod
- func IsRunningOnKindInfra() bool
- func LibvirtDomainIsPaused(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (bool, error)
- func ListCgroupThreads(pod *k8sv1.Pod) (output string, err error)
- func MountCloudInitFunc(devName string) func(*v1.VirtualMachineInstance)
- func NewBool(x bool) *bool
- func NewHTTPServerPod(ipFamily, port int) *corev1.Pod
- func NewInt32(x int32) *int32
- func NewRandomFedoraVMI(opts ...libvmi.Option) *v1.VirtualMachineInstance
- func NewRandomFedoraVMIWithBlacklistGuestAgent(commands string) *v1.VirtualMachineInstance
- func NewRandomFedoraVMIWithEphemeralDiskHighMemory() *v1.VirtualMachineInstance
- func NewRandomMigration(vmiName string, namespace string) *v1.VirtualMachineInstanceMigration
- func NewRandomReplicaSetFromVMI(vmi *v1.VirtualMachineInstance, replicas int32) *v1.VirtualMachineInstanceReplicaSet
- func NewRandomVMI() *v1.VirtualMachineInstance
- func NewRandomVMIWithDataVolume(dataVolumeName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDisk(containerImage string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataHighMemory(containerImage string, userData string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndUserdataHighMemory(containerImage string, userData string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskAndUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralDiskHighMemory(containerImage string) *v1.VirtualMachineInstance
- func NewRandomVMIWithEphemeralPVC(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithHostDisk(diskPath string, diskType v1.HostDiskType, nodeName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithPVC(claimName string) *v1.VirtualMachineInstance
- func NewRandomVMIWithPVCAndUserData(claimName, userData string) *v1.VirtualMachineInstance
- func NewRandomVMWithDataVolume(imageUrl string, namespace string) (*v1.VirtualMachine, bool)
- func NewRandomVMWithDataVolumeAndUserData(dataVolume *cdiv1.DataVolume, userData string) *v1.VirtualMachine
- func NewRandomVMWithDataVolumeAndUserDataInStorageClass(imageUrl, namespace, userData, storageClass string) *v1.VirtualMachine
- func NewRandomVMWithDataVolumeWithRegistryImport(imageUrl, namespace, storageClass string, ...) *v1.VirtualMachine
- func NewRandomVMWithEphemeralDisk(containerImage string) *v1.VirtualMachine
- func NewRandomVirtualMachine(vmi *v1.VirtualMachineInstance, running bool) *v1.VirtualMachine
- func NewRandomVirtualMachineInstanceWithBlockDisk(imageUrl, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
- func NewRandomVirtualMachineInstanceWithDisk(imageUrl, namespace, sc string, accessMode k8sv1.PersistentVolumeAccessMode, ...) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
- func NewRandomVirtualMachineInstanceWithFileDisk(imageUrl, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
- func NewTCPServerPod(ipFamily, port int) *corev1.Pod
- func NodeNameWithHandler() string
- func NotDeleted(vmis *v1.VirtualMachineInstanceList) (notDeleted []v1.VirtualMachineInstance)
- func NotDeletedVMs(vms *v1.VirtualMachineList) (notDeleted []v1.VirtualMachine)
- func PrepareMetricsURL(ip string, port int) string
- func PrometheusRuleEnabled() bool
- func RandTmpDir() string
- func RemoveFaultyDisk(nodeName, deviceName string)
- func RemoveHostDiskImage(diskPath string, nodeName string)
- func RemoveSCSIDisk(nodeName, address string)
- func RenameImgFile(pvc *k8sv1.PersistentVolumeClaim, newName string)
- func RenderHostPathPod(podName string, dir string, hostPathType k8sv1.HostPathType, ...) *k8sv1.Pod
- func RenderPod(name string, cmd []string, args []string) *k8sv1.Pod
- func RenderPrivilegedPod(name string, cmd []string, args []string) *k8sv1.Pod
- func RenderTargetcliPod(name, disksPVC string) *k8sv1.Pod
- 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 RunCommandOnVmiTargetPod(vmi *v1.VirtualMachineInstance, command []string) (string, error)
- func RunPod(pod *k8sv1.Pod) *k8sv1.Pod
- func RunPodAndExpectCompletion(pod *k8sv1.Pod) *k8sv1.Pod
- func RunPodInNamespace(pod *k8sv1.Pod, namespace string) *k8sv1.Pod
- func RunVMI(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
- 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 Running(vmis *v1.VirtualMachineInstanceList) (running []v1.VirtualMachineInstance)
- func ServiceMonitorEnabled() bool
- func SetupAlpineHostPath()
- func StartExampleGuestAgent(vmi *v1.VirtualMachineInstance, useTLS bool, port uint32) error
- func StartHTTPServer(vmi *v1.VirtualMachineInstance, port int, loginTo console.LoginToFunction)
- func StartHTTPServerPod(ipFamily, port int) *corev1.Pod
- func StartHTTPServerWithSourceIp(vmi *v1.VirtualMachineInstance, port int, sourceIP string, ...)
- func StartPythonHttpServer(vmi *v1.VirtualMachineInstance, port int)
- func StartPythonUDPServer(vmi *v1.VirtualMachineInstance, port int, ipFamily k8sv1.IPFamily)
- func StartTCPServer(vmi *v1.VirtualMachineInstance, port int, loginTo console.LoginToFunction)
- func StartTCPServerPod(ipFamily, port int) *corev1.Pod
- func StartVMAndExpectRunning(virtClient kubecli.KubevirtClient, vm *v1.VirtualMachine) *v1.VirtualMachine
- 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 TestCleanup()
- 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" )
const ( TCPServer = server("\"Hello World!\"&\n") HTTPServer = server("\"HTTP/1.1 200 OK\\nContent-Length: 12\\n\\nHello World!\"&\n") )
Variables ¶
This section is empty.
Functions ¶
func AddBootOrderToDisk ¶ added in v0.6.0
func AddBootOrderToDisk(vmi *v1.VirtualMachineInstance, diskName string, bootorder *uint) *v1.VirtualMachineInstance
func AddCloudInitConfigDriveData ¶ added in v0.19.0
func AddCloudInitConfigDriveData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, b64encode bool)
func AddCloudInitNoCloudData ¶ added in v0.19.0
func AddCloudInitNoCloudData(vmi *v1.VirtualMachineInstance, name, userData, networkData string, b64encode bool)
func AddConfigMapDisk ¶ added in v0.9.0
func AddConfigMapDisk(vmi *v1.VirtualMachineInstance, configMapName string, volumeName string)
func AddConfigMapDiskWithCustomLabel ¶ added in v0.29.0
func AddConfigMapDiskWithCustomLabel(vmi *v1.VirtualMachineInstance, configMapName string, volumeName string, volumeLabel string)
func AddEphemeralCdrom ¶ added in v0.12.0
func AddEphemeralCdrom(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, image string) *v1.VirtualMachineInstance
func AddEphemeralDisk ¶ added in v0.3.0
func AddEphemeralDisk(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, image string) *v1.VirtualMachineInstance
func AddExplicitPodNetworkInterface ¶ added in v0.7.0
func AddExplicitPodNetworkInterface(vmi *v1.VirtualMachineInstance)
func AddHostDisk ¶ added in v0.9.4
func AddHostDisk(vmi *v1.VirtualMachineInstance, path string, diskType v1.HostDiskType, name string)
func AddLabelDownwardAPIVolume ¶ added in v0.35.0
func AddLabelDownwardAPIVolume(vmi *v1.VirtualMachineInstance, volumeName string)
func AddPVCDisk ¶ added in v0.5.0
func AddPVCDisk(vmi *v1.VirtualMachineInstance, name string, bus v1.DiskBus, claimName string) *v1.VirtualMachineInstance
func AddSecretDisk ¶ added in v0.9.0
func AddSecretDisk(vmi *v1.VirtualMachineInstance, secretName string, volumeName string)
func AddSecretDiskWithCustomLabel ¶ added in v0.29.0
func AddSecretDiskWithCustomLabel(vmi *v1.VirtualMachineInstance, secretName string, volumeName string, volumeLabel string)
func AddServiceAccountDisk ¶ added in v0.9.2
func AddServiceAccountDisk(vmi *v1.VirtualMachineInstance, serviceAccountName string)
func AddUserData ¶ added in v0.9.0
func AddUserData(vmi *v1.VirtualMachineInstance, name string, userData string)
func AddWatchdog ¶ added in v1.1.0
func AddWatchdog(vmi *v1.VirtualMachineInstance, action v1.WatchdogAction)
func AppendEmptyDisk ¶ added in v0.16.0
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 CheckResultShellCommandOnVmi ¶ added in v1.1.0
func CheckResultShellCommandOnVmi(vmi *v1.VirtualMachineInstance, cmd, output string, timeout int)
func CopyAlpineWithNonQEMUPermissions ¶ added in v0.48.0
func CopyAlpineWithNonQEMUPermissions() (dstPath, nodeName string)
func CreateConfigMap ¶ added in v0.9.0
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 CreateExecutorPodWithPVC ¶ added in v0.54.0
func CreateExecutorPodWithPVC(podName string, pvc *k8sv1.PersistentVolumeClaim) *k8sv1.Pod
CreateExecutorPodWithPVC creates a Pod with the passed in PVC mounted under /pvc. You can then use the executor utilities to run commands against the PVC through this Pod.
func CreateFaultyDisk ¶ added in v0.41.1
func CreateFaultyDisk(nodeName, deviceName string)
func CreateHostDiskImage ¶ added in v0.9.0
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 CreateSecret ¶ added in v0.9.0
func CreateVmiOnNode ¶ added in v0.47.0
func CreateVmiOnNode(vmi *v1.VirtualMachineInstance, nodeName string) *v1.VirtualMachineInstance
CreateVmiOnNode creates a VMI on the specified node
func CreateVmiOnNodeLabeled ¶ added in v0.49.1
func CreateVmiOnNodeLabeled(vmi *v1.VirtualMachineInstance, nodeLabel, labelValue string) *v1.VirtualMachineInstance
CreateVmiOnNodeLabeled creates a VMI a node that has a give label set to a given value
func DeleteAlpineWithNonQEMUPermissions ¶ added in v0.48.0
func DeleteAlpineWithNonQEMUPermissions()
func DeleteConfigMap ¶ added in v0.9.0
func DeleteConfigMap(name, namespace string)
func DeletePvAndPvc ¶ added in v0.9.2
func DeletePvAndPvc(name string)
func DeleteSecret ¶ added in v0.9.0
func DeleteSecret(name, namespace string)
func DeprecatedBeforeAll
deprecated
added in
v0.52.0
func DeprecatedBeforeAll(fn func())
Deprecated: DeprecatedBeforeAll must not be used. Tests need to be self-contained to allow sane cleanup, accurate reporting and parallel execution.
func DisableFeatureGate ¶ added in v0.20.0
func DisableFeatureGate(feature string)
func DryRunCreate ¶ added in v0.47.0
func DryRunPatch ¶ added in v0.47.0
func DryRunUpdate ¶ added in v0.47.0
func EnableFeatureGate ¶ added in v0.20.0
func EncodePrivateKeyToPEM ¶ added in v0.19.0
func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte
EncodePrivateKeyToPEM encodes Private Key from RSA to PEM format
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 ExecuteCommandOnNodeThroughVirtHandler ¶ added in v0.53.0
func ExpectResourceVersionToBeLessEqualThanConfigVersion ¶ added in v0.52.0
func FixErrorDevice ¶ added in v0.44.1
func FixErrorDevice(nodeName string)
func ForwardPorts ¶ added in v0.17.0
func GenerateHelloWorldServer ¶ added in v0.19.0
func GenerateHelloWorldServer(vmi *v1.VirtualMachineInstance, testPort int, protocol string, loginTo console.LoginToFunction, sudoNeeded bool)
func GeneratePrivateKey ¶ added in v0.19.0
func GeneratePrivateKey(bitSize int) (*rsa.PrivateKey, error)
GeneratePrivateKey creates a RSA Private Key of specified byte size
func GeneratePublicKey ¶ added in v0.19.0
GeneratePublicKey will return in the format "ssh-rsa ..."
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 GetCertFromSecret ¶ added in v0.29.0
func GetCertsForPods ¶ added in v0.29.0
GetCertsForPods returns the used certificates for all pods matching the label selector
func GetComputeContainerOfPod ¶ added in v0.19.0
func GetContainerOfPod ¶ added in v0.19.0
func GetDefaultExportProxyDeployment ¶ added in v0.58.1
func GetDefaultExportProxyDeployment(namespace string, config *util.KubeVirtDeploymentConfig) (*v12.Deployment, error)
func GetDefaultVirtApiDeployment ¶ added in v0.58.1
func GetDefaultVirtApiDeployment(namespace string, config *util.KubeVirtDeploymentConfig) (*v12.Deployment, error)
func GetDefaultVirtControllerDeployment ¶ added in v0.58.1
func GetDefaultVirtControllerDeployment(namespace string, config *util.KubeVirtDeploymentConfig) (*v12.Deployment, error)
func GetDefaultVirtHandlerDaemonSet ¶ added in v0.58.1
func GetFedoraToolsGuestAgentBlacklistUserData ¶ added in v0.36.3
func GetIdOfLauncher ¶ added in v0.52.0
func GetIdOfLauncher(vmi *v1.VirtualMachineInstance) string
func GetKubevirtVMMetricsFunc ¶ added in v0.53.0
func GetKvmPitMask ¶ added in v0.58.2
func GetNodeHostModel ¶ added in v0.49.1
func GetPodByVirtualMachineInstance ¶ added in v0.17.0
func GetPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance) *k8sv1.Pod
func GetPodsCertIfSynced ¶ added in v0.29.0
func GetPodsCertIfSynced(labelSelector string, namespace string, port string) (cert []byte, synced bool, err error)
GetPodsCertIfSynced returns the certificate for all matching pods once all of them use the same certificate
func GetProcessName ¶ added in v0.58.1
func GetRunningPodByLabel ¶ added in v0.3.0
func GetRunningPodByVirtualMachineInstance ¶ added in v0.8.0
func GetRunningPodByVirtualMachineInstance(vmi *v1.VirtualMachineInstance, namespace string) *k8sv1.Pod
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 GetSupportedCPUFeatures ¶ added in v0.40.0
func GetSupportedCPUModels ¶ added in v0.40.0
func GetVcpuMask ¶ added in v0.58.2
func GetVmPodName ¶ added in v0.15.0
func GetVmPodName(virtCli kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) string
func GetVmiPod ¶ added in v1.0.0
func GetVmiPod(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) *k8sv1.Pod
func IsRunningOnKindInfra ¶ added in v0.29.0
func IsRunningOnKindInfra() bool
func LibvirtDomainIsPaused ¶ added in v0.41.0
func LibvirtDomainIsPaused(virtClient kubecli.KubevirtClient, vmi *v1.VirtualMachineInstance) (bool, error)
func ListCgroupThreads ¶ added in v0.58.1
func MountCloudInitFunc ¶ added in v0.46.0
func MountCloudInitFunc(devName string) func(*v1.VirtualMachineInstance)
func NewHTTPServerPod ¶ added in v0.34.0
func NewRandomFedoraVMI ¶ added in v0.39.0
func NewRandomFedoraVMI(opts ...libvmi.Option) *v1.VirtualMachineInstance
func NewRandomFedoraVMIWithBlacklistGuestAgent ¶ added in v0.36.3
func NewRandomFedoraVMIWithBlacklistGuestAgent(commands string) *v1.VirtualMachineInstance
func NewRandomFedoraVMIWithEphemeralDiskHighMemory ¶ added in v1.1.0
func NewRandomFedoraVMIWithEphemeralDiskHighMemory() *v1.VirtualMachineInstance
func NewRandomMigration ¶ added in v0.9.2
func NewRandomMigration(vmiName string, namespace string) *v1.VirtualMachineInstanceMigration
func NewRandomReplicaSetFromVMI ¶ added in v0.6.1
func NewRandomReplicaSetFromVMI(vmi *v1.VirtualMachineInstance, replicas int32) *v1.VirtualMachineInstanceReplicaSet
func NewRandomVMI ¶ added in v0.6.1
func NewRandomVMI() *v1.VirtualMachineInstance
func NewRandomVMIWithDataVolume ¶ added in v0.8.0
func NewRandomVMIWithDataVolume(dataVolumeName string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDisk ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDisk(containerImage string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdata ¶ added in v0.19.0
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataHighMemory ¶ added in v0.19.0
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataHighMemory(containerImage string, userData string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataNetworkData ¶ added in v0.19.0
func NewRandomVMIWithEphemeralDiskAndConfigDriveUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndUserdata ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDiskAndUserdata(containerImage string, userData string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndUserdataHighMemory ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDiskAndUserdataHighMemory(containerImage string, userData string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskAndUserdataNetworkData ¶ added in v0.14.0
func NewRandomVMIWithEphemeralDiskAndUserdataNetworkData(containerImage, userData, networkData string, b64encode bool) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralDiskHighMemory ¶ added in v0.6.1
func NewRandomVMIWithEphemeralDiskHighMemory(containerImage string) *v1.VirtualMachineInstance
func NewRandomVMIWithEphemeralPVC ¶ added in v0.6.1
func NewRandomVMIWithEphemeralPVC(claimName string) *v1.VirtualMachineInstance
func NewRandomVMIWithHostDisk ¶ added in v0.9.0
func NewRandomVMIWithHostDisk(diskPath string, diskType v1.HostDiskType, nodeName string) *v1.VirtualMachineInstance
func NewRandomVMIWithPVC ¶ added in v0.6.1
func NewRandomVMIWithPVC(claimName string) *v1.VirtualMachineInstance
func NewRandomVMIWithPVCAndUserData ¶ added in v0.34.0
func NewRandomVMIWithPVCAndUserData(claimName, userData string) *v1.VirtualMachineInstance
func NewRandomVMWithDataVolume ¶ added in v0.8.0
func NewRandomVMWithDataVolume(imageUrl string, namespace string) (*v1.VirtualMachine, bool)
func NewRandomVMWithDataVolumeAndUserData ¶ added in v0.44.1
func NewRandomVMWithDataVolumeAndUserData(dataVolume *cdiv1.DataVolume, userData string) *v1.VirtualMachine
func NewRandomVMWithDataVolumeAndUserDataInStorageClass ¶ added in v0.34.0
func NewRandomVMWithDataVolumeAndUserDataInStorageClass(imageUrl, namespace, userData, storageClass string) *v1.VirtualMachine
func NewRandomVMWithDataVolumeWithRegistryImport ¶ added in v0.44.2
func NewRandomVMWithDataVolumeWithRegistryImport(imageUrl, namespace, storageClass string, accessMode k8sv1.PersistentVolumeAccessMode) *v1.VirtualMachine
func NewRandomVMWithEphemeralDisk ¶
func NewRandomVMWithEphemeralDisk(containerImage string) *v1.VirtualMachine
func NewRandomVirtualMachine ¶ added in v0.8.0
func NewRandomVirtualMachine(vmi *v1.VirtualMachineInstance, running bool) *v1.VirtualMachine
func NewRandomVirtualMachineInstanceWithBlockDisk ¶ added in v0.49.1
func NewRandomVirtualMachineInstanceWithBlockDisk(imageUrl, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
func NewRandomVirtualMachineInstanceWithDisk ¶ added in v0.49.1
func NewRandomVirtualMachineInstanceWithDisk(imageUrl, namespace, sc string, accessMode k8sv1.PersistentVolumeAccessMode, volMode k8sv1.PersistentVolumeMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
func NewRandomVirtualMachineInstanceWithFileDisk ¶ added in v0.49.1
func NewRandomVirtualMachineInstanceWithFileDisk(imageUrl, namespace string, accessMode k8sv1.PersistentVolumeAccessMode) (*v1.VirtualMachineInstance, *cdiv1.DataVolume)
func NewTCPServerPod ¶ added in v0.34.0
func NodeNameWithHandler ¶ added in v0.41.1
func NodeNameWithHandler() string
func NotDeleted ¶ added in v0.5.0
func NotDeleted(vmis *v1.VirtualMachineInstanceList) (notDeleted []v1.VirtualMachineInstance)
func NotDeletedVMs ¶ added in v0.49.0
func NotDeletedVMs(vms *v1.VirtualMachineList) (notDeleted []v1.VirtualMachine)
func PrepareMetricsURL ¶ added in v0.53.0
func PrometheusRuleEnabled ¶ added in v0.26.0
func PrometheusRuleEnabled() bool
PrometheusRuleEnabled returns true if the PrometheusRule CRD is enabled and false otherwise.
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 RenameImgFile ¶ added in v0.58.0
func RenameImgFile(pvc *k8sv1.PersistentVolumeClaim, newName string)
func RenderHostPathPod ¶ added in v0.33.0
func RenderHostPathPod(podName string, dir string, hostPathType k8sv1.HostPathType, mountPropagation k8sv1.MountPropagationMode, cmd []string, args []string) *k8sv1.Pod
func RenderPrivilegedPod ¶ added in v0.39.0
func RenderTargetcliPod ¶ added in v1.0.0
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 RunCommandOnVmiTargetPod ¶ added in v0.36.4
func RunCommandOnVmiTargetPod(vmi *v1.VirtualMachineInstance, command []string) (string, error)
RunCommandOnVmiTargetPod runs specified command on the target virt-launcher pod of a migration
func RunPodAndExpectCompletion ¶ added in v0.48.0
func RunPodInNamespace ¶ added in v0.58.0
func RunVMI ¶ added in v0.9.0
func RunVMI(vmi *v1.VirtualMachineInstance, timeout int) *v1.VirtualMachineInstance
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 Running ¶ added in v0.35.0
func Running(vmis *v1.VirtualMachineInstanceList) (running []v1.VirtualMachineInstance)
func ServiceMonitorEnabled ¶ added in v0.20.6
func ServiceMonitorEnabled() bool
func SetupAlpineHostPath ¶ added in v0.55.0
func SetupAlpineHostPath()
func StartExampleGuestAgent ¶ added in v0.59.0
func StartExampleGuestAgent(vmi *v1.VirtualMachineInstance, useTLS bool, port uint32) error
func StartHTTPServer ¶ added in v0.11.0
func StartHTTPServer(vmi *v1.VirtualMachineInstance, port int, loginTo console.LoginToFunction)
func StartHTTPServerPod ¶ added in v0.34.0
func StartHTTPServerWithSourceIp ¶ added in v0.52.0
func StartHTTPServerWithSourceIp(vmi *v1.VirtualMachineInstance, port int, sourceIP string, loginTo console.LoginToFunction)
func StartPythonHttpServer ¶ added in v0.37.0
func StartPythonHttpServer(vmi *v1.VirtualMachineInstance, port int)
func StartPythonUDPServer ¶ added in v0.56.0
func StartPythonUDPServer(vmi *v1.VirtualMachineInstance, port int, ipFamily k8sv1.IPFamily)
func StartTCPServer ¶ added in v0.11.0
func StartTCPServer(vmi *v1.VirtualMachineInstance, port int, loginTo console.LoginToFunction)
func StartTCPServerPod ¶ added in v0.34.0
func StartVMAndExpectRunning ¶ added in v0.53.0
func StartVMAndExpectRunning(virtClient kubecli.KubevirtClient, vm *v1.VirtualMachine) *v1.VirtualMachine
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 TestCleanup ¶ added in v0.55.0
func TestCleanup()
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
|
|