add ephemeral-backed pvc converter test
@@ -153,6 +153,10 @@ var _ = Describe("Converter", func() {
Name: "should_default_to_disk",
VolumeName: "volume4",
},
+ {
+ Name: "ephemeral_pvc",
+ VolumeName: "volume5",
+ },
}
vm.Spec.Volumes = []v1.Volume{
{
@@ -211,6 +215,16 @@ var _ = Describe("Converter", func() {
},
},
},
+ {
+ Name: "volume5",
+ VolumeSource: v1.VolumeSource{
+ Ephemeral: &v1.EphemeralVolumeSource{
+ PersistentVolumeClaim: &k8sv1.PersistentVolumeClaimVolumeSource{
+ ClaimName: "testclaim",
+ },
+ },
+ },
+ },
}
vm.Spec.Domain.Firmware = &v1.Firmware{
UUID: "e4686d2c-6e8d-4335-b8fd-81bee22f4814",
@@ -290,6 +304,16 @@ var _ = Describe("Converter", func() {
<driver name="qemu" type="raw"></driver>
<alias name="should_default_to_disk"></alias>
</disk>
+ <disk device="disk" type="file">
+ <source file="/var/run/libvirt/kubevirt-ephemeral-disk/volume5/disk.qcow2"></source>
+ <target bus="sata" dev="sdd"></target>
+ <driver name="qemu" type="qcow2"></driver>
+ <alias name="ephemeral_pvc"></alias>
+ <backingStore type="file">
+ <format type="raw"></format>
+ <source file="/var/run/kubevirt-private/vm-disks/volume5/disk.img"></source>
+ </backingStore>
+ </disk>
<serial type="unix">
<target port="0"></target>
<source mode="bind" path="/var/run/kubevirt-private/mynamespace/testvm/virt-serial0"></source>
