tests, windows, Use vmi spec in order to get namespace
Instead of using the global all over,
get namespace from vmi spec after vmi is created.
@@ -147,7 +147,7 @@ var _ = Describe("[Serial][sig-compute]Windows VirtualMachineInstance", func() {
tests.WaitForSuccessfulVMIStartWithTimeout(vmi, 360)
By("Stopping the vmi")
- err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Delete(vmi.Name, &metav1.DeleteOptions{})
+ err = virtClient.VirtualMachineInstance(vmi.Namespace).Delete(vmi.Name, &metav1.DeleteOptions{})
Expect(err).To(BeNil())
}, 300)
@@ -287,7 +287,7 @@ var _ = Describe("[Serial][sig-compute]Windows VirtualMachineInstance", func() {
func winrnLoginCommand(virtClient kubecli.KubevirtClient, windowsVMI *v1.VirtualMachineInstance) []string {
var err error
- windowsVMI, err = virtClient.VirtualMachineInstance(util.NamespaceTestDefault).Get(windowsVMI.Name, &metav1.GetOptions{})
+ windowsVMI, err = virtClient.VirtualMachineInstance(windowsVMI.Namespace).Get(windowsVMI.Name, &metav1.GetOptions{})
ExpectWithOffset(1, err).ToNot(HaveOccurred())
vmiIp := windowsVMI.Status.Interfaces[0].IP
