Skip to content

Commit

Permalink
Change cirros efi example to use alpine like our functional tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Vossel <[email protected]>
  • Loading branch information
davidvossel committed Jan 29, 2019
1 parent 20c07c4 commit 7e77958
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachineInstance
metadata:
labels:
special: vmi-cirros-efi
name: vmi-cirros-efi
special: vmi-alpine-efi
name: vmi-alpine-efi
spec:
domain:
devices:
autoattachPodInterface: false
disks:
- disk:
bus: virtio
Expand All @@ -20,9 +19,9 @@ spec:
type: ""
resources:
requests:
memory: 64M
memory: 1Gi
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: registry:5000/kubevirt/cirros-container-disk-demo:devel
image: registry:5000/kubevirt/alpine-container-disk-demo:devel
name: containerdisk
11 changes: 5 additions & 6 deletions tools/vms-generator/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
VmiFlavorSmall = "vmi-flavor-small"
VmiSata = "vmi-sata"
VmiFedora = "vmi-fedora"
VmiCirrosEFI = "vmi-cirros-efi"
VmiAlpineEFI = "vmi-alpine-efi"
VmiNoCloud = "vmi-nocloud"
VmiPVC = "vmi-pvc"
VmiBlockPVC = "vmi-block-pvc"
Expand Down Expand Up @@ -312,18 +312,17 @@ func GetVMIEphemeralFedora() *v1.VirtualMachineInstance {
return vmi
}

func GetVMICirrosEFI() *v1.VirtualMachineInstance {
vmi := getBaseVMI(VmiCirrosEFI)
func GetVMIAlpineEFI() *v1.VirtualMachineInstance {
vmi := getBaseVMI(VmiAlpineEFI)

addContainerDisk(&vmi.Spec, fmt.Sprintf("%s/%s:%s", DockerPrefix, imageCirros, DockerTag), busVirtio)
addContainerDisk(&vmi.Spec, fmt.Sprintf("%s/%s:%s", DockerPrefix, imageAlpine, DockerTag), busVirtio)
vmi.Spec.Domain.Firmware = &v1.Firmware{
Bootloader: &v1.Bootloader{
EFI: &v1.EFI{},
},
}

disable := false
vmi.Spec.Domain.Devices.AutoattachPodInterface = &disable
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1Gi")
return vmi
}

Expand Down
2 changes: 1 addition & 1 deletion tools/vms-generator/vms-generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {
utils.VmiFlavorSmall: utils.GetVMIFlavorSmall(),
utils.VmiSata: utils.GetVMISata(),
utils.VmiFedora: utils.GetVMIEphemeralFedora(),
utils.VmiCirrosEFI: utils.GetVMICirrosEFI(),
utils.VmiAlpineEFI: utils.GetVMIAlpineEFI(),
utils.VmiNoCloud: utils.GetVMINoCloud(),
utils.VmiPVC: utils.GetVMIPvc(),
utils.VmiBlockPVC: utils.GetVMIBlockPvc(),
Expand Down

0 comments on commit 7e77958

Please sign in to comment.