Only set status to Running if the VM is not already in that state.
@@ -23,6 +23,7 @@ func NewVMController(listWatcher cache.ListerWatcher, domainManager libvirt.Doma
return cache.ErrRequeue{Err: err}
}
+ if vm.Status.Phase != v1.Running {
restClient, err := kubecli.GetRESTClient()
if err != nil {
return cache.ErrRequeue{Err: err}
@@ -33,7 +34,7 @@ func NewVMController(listWatcher cache.ListerWatcher, domainManager libvirt.Doma
if err != nil {
return cache.ErrRequeue{Err: err}
}
-
+ }
return nil
},
DeleteFunc: func(obj interface{}) error {
