Skip to content

Commit 2dc62f0

Browse files
committed
fix: add logs for instance manager state error update
Longhorn 10800 Signed-off-by: Shuo Wu <shuo.wu@suse.com>
1 parent 115f8c1 commit 2dc62f0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

controller/instance_manager_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,14 @@ func (imc *InstanceManagerController) syncStatusWithPod(im *longhorn.InstanceMan
460460
im.Status.CurrentState = longhorn.InstanceManagerStateStopped
461461
return nil
462462
}
463+
imc.logger.Warnf("Instance manager pod %v is not found, updating the instance manager state from %s to error", im.Name, im.Status.CurrentState)
463464
im.Status.CurrentState = longhorn.InstanceManagerStateError
464465
return nil
465466
}
466467

467468
// By design instance manager pods should not be terminated.
468469
if pod.DeletionTimestamp != nil {
470+
imc.logger.Warnf("Instance manager pod %v is being deleted, updating the instance manager state from %s to error", im.Name, im.Status.CurrentState)
469471
im.Status.CurrentState = longhorn.InstanceManagerStateError
470472
return nil
471473
}
@@ -488,6 +490,7 @@ func (imc *InstanceManagerController) syncStatusWithPod(im *longhorn.InstanceMan
488490
im.Status.CurrentState = longhorn.InstanceManagerStateStarting
489491
}
490492
default:
493+
imc.logger.Warnf("Instance manager pod %v is in phase %s, updating the instance manager state from %s to error", im.Name, pod.Status.Phase, im.Status.CurrentState)
491494
im.Status.CurrentState = longhorn.InstanceManagerStateError
492495
}
493496

0 commit comments

Comments
 (0)