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>
This commit is contained in:
Madhu Rajanna 2021-08-05 14:41:28 +05:30 committed by mergify[bot]
parent 2c66dfc3e4
commit 2782878ea2

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