Skip to content

Commit 95f5703

Browse files
shuo-wuderekbit
authored andcommitted
chore: add state update log for instance handler
Signed-off-by: Shuo Wu <shuo.wu@suse.com>
1 parent 16b59ba commit 95f5703

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

controller/instance_handler.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ func (h *InstanceHandler) ReconcileInstanceState(obj interface{}, spec *longhorn
286286

287287
log := logrus.WithFields(logrus.Fields{"instance": instanceName, "volumeName": spec.VolumeName, "dataEngine": spec.DataEngine, "specNodeID": spec.NodeID})
288288

289+
stateBeforeReconcile := status.CurrentState
290+
defer func() {
291+
if stateBeforeReconcile != status.CurrentState {
292+
log.Infof("Instance %v state is updated from %v to %v", instanceName, stateBeforeReconcile, status.CurrentState)
293+
}
294+
}()
295+
289296
var im *longhorn.InstanceManager
290297
if status.InstanceManagerName != "" {
291298
im, err = h.ds.GetInstanceManagerRO(status.InstanceManagerName)

0 commit comments

Comments
 (0)