Skip to content

Commit

Permalink
Fix endless virt-handler requeue
Browse files Browse the repository at this point in the history
If the VM is already marked as running, don't try to update it on the
cluster again, to prefent indefinite controller requeues.

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Jul 19, 2017
1 parent 02589cf commit 47f80c9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/virt-handler/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ func (d *VMHandlerDispatch) updateVMStatus(vm *v1.VM, cfg *api.DomainSpec) error
return err
}
vm = obj.(*v1.VM)

// XXX When we start supporting hotplug, this needs to be altered.
// Check if the VM is already marked as running. If yes, don't update the VM.
// Otherwise we end up in endless controller requeues.
if vm.Status.Phase == v1.Running {
return nil
}

vm.Status.Phase = v1.Running

vm.Status.Graphics = []v1.VMGraphics{}
Expand Down

0 comments on commit 47f80c9

Please sign in to comment.