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 <madhupr007@gmail.com>
(cherry picked from commit 2782878ea2)
This commit is contained in:
Madhu Rajanna 2021-08-05 14:41:28 +05:30 committed by mergify[bot]
parent 0b43e91c77
commit 75ff33785b

View File

@ -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,
}