tests, multi queue: Use pointer.Bool
It is nicer than defining a boolean
and referring it manually.
@@ -31,6 +31,7 @@ import (
k8sv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/utils/pointer"
v1 "kubevirt.io/api/core/v1"
"kubevirt.io/client-go/kubecli"
@@ -67,8 +68,7 @@ var _ = Describe("[sig-compute]MultiQueue", func() {
)
cpuReq := resource.MustParse(fmt.Sprintf("%d", numCpus))
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceCPU] = cpuReq
- multiQueue := true
- vmi.Spec.Domain.Devices.NetworkInterfaceMultiQueue = &multiQueue
+ vmi.Spec.Domain.Devices.NetworkInterfaceMultiQueue = pointer.Bool(true)
vmi.Spec.Domain.Devices.Rng = &v1.Rng{}
By("Creating and starting the VMI")
@@ -87,8 +87,7 @@ var _ = Describe("[sig-compute]MultiQueue", func() {
fmt.Sprintf("Testing environment only has nodes with %d CPUs available, but required are %d CPUs", availableCPUs, numCpus),
)
- multiQueue := true
- vmi.Spec.Domain.Devices.BlockMultiQueue = &multiQueue
+ vmi.Spec.Domain.Devices.BlockMultiQueue = pointer.Bool(true)
cpuReq := resource.MustParse(fmt.Sprintf("%d", numCpus))
vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceCPU] = cpuReq
@@ -128,9 +127,8 @@ var _ = Describe("[sig-compute]MultiQueue", func() {
It("should be able to create a multi-queue VMI when requesting a single vCPU", func() {
vmi := libvmi.NewCirros()
- multiQueue := true
vmi.Spec.Domain.CPU = &v1.CPU{Cores: 1, Sockets: 1, Threads: 1}
- vmi.Spec.Domain.Devices.NetworkInterfaceMultiQueue = &multiQueue
+ vmi.Spec.Domain.Devices.NetworkInterfaceMultiQueue = pointer.Bool(true)
By("Creating and starting the VMI")
vmi, err := virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Create(vmi)
