From 2782878ea20c7d49f392ccdb948001eb0e1b83e0 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 5 Aug 2021 14:41:28 +0530 Subject: [PATCH] rbd: log LastUpdate in UTC format This Commit converts the LastUpdate from int to the UTC format and logs it for better debugging. Signed-off-by: Madhu Rajanna --- internal/rbd/replicationcontrollerserver.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/rbd/replicationcontrollerserver.go b/internal/rbd/replicationcontrollerserver.go index 43e11af5b..940ee245b 100644 --- a/internal/rbd/replicationcontrollerserver.go +++ b/internal/rbd/replicationcontrollerserver.go @@ -23,6 +23,7 @@ import ( "regexp" "strconv" "strings" + "time" "github.com/ceph/ceph-csi/internal/util" @@ -615,12 +616,15 @@ func (rs *ReplicationServer) ResyncVolume(ctx context.Context, } } + // convert the last update time to UTC + lastUpdateTime := time.Unix(localStatus.LastUpdate, 0).UTC() util.UsefulLog( ctx, "image mirroring state=%s, description=%s and lastUpdate=%s", localStatus.State.String(), localStatus.Description, - localStatus.LastUpdate) + lastUpdateTime) + resp := &replication.ResyncVolumeResponse{ Ready: ready, }