File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -139,20 +139,19 @@ func RebootVirtualMachineByVMOP(f *framework.Framework, vm *v1alpha2.VirtualMach
139139}
140140
141141func UntilVirtualMachineRebooted (key client.ObjectKey , previousRunningTime time.Time , timeout time.Duration ) {
142- vm := & v1alpha2.VirtualMachine {}
143142 Eventually (func () error {
143+ vm := & v1alpha2.VirtualMachine {}
144144 err := framework .GetClients ().GenericClient ().Get (context .Background (), key , vm )
145145 if err != nil {
146146 return fmt .Errorf ("failed to get virtual machine: %w" , err )
147147 }
148148
149149 runningCondition , _ := conditions .GetCondition (vmcondition .TypeRunning , vm .Status .Conditions )
150150
151- if runningCondition .LastTransitionTime .Time .After (previousRunningTime ) {
151+ if runningCondition .LastTransitionTime .Time .After (previousRunningTime ) && vm . Status . Phase == v1alpha2 . MachineRunning {
152152 return nil
153153 }
154154
155155 return fmt .Errorf ("virtual machine %s is not rebooted" , key .Name )
156- }, timeout / 2 , time .Second ).Should (Succeed ())
157- UntilObjectPhase (string (v1alpha2 .MachineRunning ), timeout / 2 , vm )
156+ }, timeout , time .Second ).Should (Succeed ())
158157}
You can’t perform that action at this time.
0 commit comments