instancetype: Move variable scope in tests
Move variable definitions to the scope of their usage.
@@ -2775,10 +2775,8 @@ var _ = Describe("VirtualMachine", func() {
vm *virtv1.VirtualMachine
vmi *virtv1.VirtualMachineInstance
instancetypeObj *instancetypev1alpha1.VirtualMachineInstancetype
- instancetypeSpec instancetypev1alpha1.VirtualMachineInstancetypeSpec
clusterInstancetypeObj *instancetypev1alpha1.VirtualMachineClusterInstancetype
preference *instancetypev1alpha1.VirtualMachinePreference
- preferenceSpec instancetypev1alpha1.VirtualMachinePreferenceSpec
clusterPreference *instancetypev1alpha1.VirtualMachineClusterPreference
fakeInstancetypeClients v1alpha1.InstancetypeV1alpha1Interface
fakeInstancetypeClient v1alpha1.VirtualMachineInstancetypeInterface
@@ -2811,7 +2809,7 @@ var _ = Describe("VirtualMachine", func() {
k8sClient = k8sfake.NewSimpleClientset()
virtClient.EXPECT().AppsV1().Return(k8sClient.AppsV1()).AnyTimes()
- instancetypeSpec = instancetypev1alpha1.VirtualMachineInstancetypeSpec{
+ instancetypeSpec := instancetypev1alpha1.VirtualMachineInstancetypeSpec{
CPU: instancetypev1alpha1.CPUInstancetype{
Guest: uint32(2),
},
@@ -2842,7 +2840,7 @@ var _ = Describe("VirtualMachine", func() {
_, err = virtClient.VirtualMachineClusterInstancetype().Create(context.Background(), clusterInstancetypeObj, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())
- preferenceSpec = instancetypev1alpha1.VirtualMachinePreferenceSpec{
+ preferenceSpec := instancetypev1alpha1.VirtualMachinePreferenceSpec{
CPU: &instancetypev1alpha1.CPUPreferences{
PreferredCPUTopology: instancetypev1alpha1.PreferThreads,
},
