From f3fdf965c6a75b5979c15e70130f8d23ba73ffe8 Mon Sep 17 00:00:00 2001 From: Rajiv Senthilnathan Date: Mon, 20 Nov 2023 16:29:04 -0500 Subject: [PATCH] Cleanup --- controllers/idler/idler_controller_test.go | 183 +-------------------- 1 file changed, 2 insertions(+), 181 deletions(-) diff --git a/controllers/idler/idler_controller_test.go b/controllers/idler/idler_controller_test.go index f63cdd8e..8902999c 100644 --- a/controllers/idler/idler_controller_test.go +++ b/controllers/idler/idler_controller_test.go @@ -1466,63 +1466,8 @@ var virtualmachineinstanceJSON = []byte(`{ "apiVersion": "kubevirt.io/v1", "kind": "VirtualMachineInstance", "metadata": { - "annotations": { - "kubevirt.io/latest-observed-api-version": "v1", - "kubevirt.io/storage-observed-api-version": "v1", - "kubevirt.io/vm-generation": "1", - "vm.kubevirt.io/flavor": "small", - "vm.kubevirt.io/os": "rhel9", - "vm.kubevirt.io/workload": "server" - }, - "creationTimestamp": "2023-11-16T18:37:55Z", - "finalizers": [ - "kubevirt.io/virtualMachineControllerFinalize", - "foregroundDeleteVirtualMachine" - ], - "generation": 4, - "labels": { - "kubevirt.io/domain": "rhel9-rajiv", - "kubevirt.io/size": "small" - }, "name": "rhel9-rajiv", - "namespace": "another-namespace", - "resourceVersion": "229052", - "uid": "51e33178-448e-4236-8006-14a21568a569" - }, - "spec": { - "architecture": "amd64", - "domain": { - "resources": { - "limits": { - "memory": "2Gi" - }, - "requests": { - "memory": "2Gi" - } - } - }, - "evictionStrategy": "LiveMigrate", - "networks": [ - { - "name": "default", - "pod": {} - } - ], - "terminationGracePeriodSeconds": 180, - "volumes": [ - { - "dataVolume": { - "name": "rhel9-rajiv" - }, - "name": "rootdisk" - }, - { - "cloudInitNoCloud": { - "userData": "#cloud-config\nuser: cloud-user\npassword: abcd-1234-ef56\nchpasswd:\n expire: false\n" - }, - "name": "cloudinitdisk" - } - ] + "namespace": "another-namespace" } }`) @@ -1530,134 +1475,10 @@ var virtualmachineJSON = []byte(`{ "apiVersion": "kubevirt.io/v1", "kind": "VirtualMachine", "metadata": { - "annotations": { - "kubevirt.io/latest-observed-api-version": "v1", - "kubevirt.io/storage-observed-api-version": "v1alpha3", - "vm.kubevirt.io/validations": "[\n {\n \"name\": \"minimal-required-memory\",\n \"path\": \"jsonpath::.spec.domain.resources.requests.memory\",\n \"rule\": \"integer\",\n \"message\": \"This VM requires more memory.\",\n \"min\": 1610612736\n }\n]\n" - }, - "creationTimestamp": "2023-09-12T15:27:31Z", - "finalizers": [ - "kubevirt.io/virtualMachineControllerFinalize" - ], - "generation": 1, - "labels": { - "app": "rhel9-rajiv", - "vm.kubevirt.io/template": "rhel9-server-small", - "vm.kubevirt.io/template.namespace": "openshift", - "vm.kubevirt.io/template.revision": "1", - "vm.kubevirt.io/template.version": "v0.25.0" - }, "name": "rhel9-rajiv", "namespace": "another-namespace" }, "spec": { - "dataVolumeTemplates": [ - { - "apiVersion": "cdi.kubevirt.io/v1beta1", - "kind": "DataVolume", - "metadata": { - "creationTimestamp": null, - "name": "rhel9-rajiv" - }, - "spec": { - "sourceRef": { - "kind": "DataSource", - "name": "rhel9", - "namespace": "openshift-virtualization-os-images" - }, - "storage": { - "resources": { - "requests": { - "storage": "30Gi" - } - } - } - } - } - ], - "running": true, - "template": { - "metadata": { - "annotations": { - "vm.kubevirt.io/flavor": "small", - "vm.kubevirt.io/os": "rhel9", - "vm.kubevirt.io/workload": "server" - }, - "creationTimestamp": null, - "labels": { - "kubevirt.io/domain": "rhel9-rajiv", - "kubevirt.io/size": "small" - } - }, - "spec": { - "domain": { - "resources": { - "requests": { - "memory": "2Gi" - } - } - }, - "evictionStrategy": "LiveMigrate", - "networks": [ - { - "name": "default", - "pod": {} - } - ], - "terminationGracePeriodSeconds": 180, - "volumes": [ - { - "dataVolume": { - "name": "rhel9-rajiv" - }, - "name": "rootdisk" - }, - { - "cloudInitNoCloud": { - "userData": "#cloud-config\nuser: cloud-user\npassword: abcd-1234-ef56\nchpasswd: { expire: False }" - }, - "name": "cloudinitdisk" - } - ] - } - } - }, - "status": { - "conditions": [ - { - "lastProbeTime": null, - "lastTransitionTime": "2023-09-12T15:32:55Z", - "status": "True", - "type": "Ready" - }, - { - "lastProbeTime": null, - "lastTransitionTime": null, - "message": "cannot migrate VMI: PVC rhel9-rajiv is not shared, live migration requires that all PVCs must be shared (using ReadWriteMany access mode)", - "reason": "DisksNotLiveMigratable", - "status": "False", - "type": "LiveMigratable" - }, - { - "lastProbeTime": "2023-09-12T15:33:14Z", - "lastTransitionTime": null, - "status": "True", - "type": "AgentConnected" - } - ], - "created": true, - "printableStatus": "Running", - "ready": true, - "volumeSnapshotStatuses": [ - { - "enabled": true, - "name": "rootdisk" - }, - { - "enabled": false, - "name": "cloudinitdisk", - "reason": "Snapshot is not supported for this volumeSource type [cloudinitdisk]" - } - ] + "running": true } }`)