mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
CSI: fix timestamp from volume snapshot responses (#12352)
Listing snapshots was incorrectly returning nanoseconds instead of seconds, and formatting of timestamps both list and create snapshot was treating the timestamp as though it were nanoseconds instead of seconds. This resulted in create timestamps always being displayed as zero values. Fix the unit conversion error in the command line and the incorrect extraction in the CSI plugin client code. Beef up the unit tests to make sure this code is actually exercised.
This commit is contained in:
@@ -186,7 +186,7 @@ func csiFormatSnapshots(snapshots []*api.CSISnapshot, verbose bool) string {
|
||||
v.ID,
|
||||
limit(v.ExternalSourceVolumeID, length),
|
||||
humanize.IBytes(uint64(v.SizeBytes)),
|
||||
formatUnixNanoTime(v.CreateTime),
|
||||
formatUnixNanoTime(v.CreateTime*1e9), // seconds to nanoseconds
|
||||
v.IsReady,
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user