cleanup finalized vmi's local data once domain is deleted
If a vmi gracefully shuts down, we were not cleaning up the
local data related to the vmi until the vmi object itself is
deleted. This causes the watchdog to timeout and create a
bunch of noise in virt-handler's logs.
@@ -928,6 +928,9 @@ func (d *VirtualMachineController) defaultExecute(key string,
if domainExists && vmiExists && vmi.IsFinal() {
log.Log.Object(vmi).V(3).Info("Removing domain and ephemeral data for finalized vmi.")
shouldDelete = true
+ } else if !domainExists && vmiExists && vmi.IsFinal() {
+ log.Log.Object(vmi).V(3).Info("Cleaning up local data for finalized vmi.")
+ shouldCleanUp = true
}
// Determine if an active (or about to be active) VirtualMachineInstance should be updated.
