Skip to content

Commit

Permalink
s3: include etag in listing (listobjectsv2)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Koo <[email protected]>
  • Loading branch information
rkoo19 committed Jan 6, 2025
1 parent 05229d8 commit 034f22e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ais/s3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,20 @@ func entryToS3(entry *cmn.LsoEnt, lsmsg *apc.LsoMsg) (oi *ObjInfo) {
// See related: `headObjS3`

oi = &ObjInfo{Key: entry.Name, Size: entry.Size, LastModified: entry.Atime}
if oi.LastModified == "" && entry.Custom != "" {
oi.LastModified = cmn.S2CustomVal(entry.Custom, cmn.LastModified)

if entry.Custom != "" {
md := make(cos.StrKVs, 4)
cmn.S2CustomMD(md, entry.Custom, "")
if oi.LastModified == "" {
oi.LastModified = md[cmn.LastModified]
}
oi.ETag = md[cmn.ETag]
}

if oi.LastModified == "" && lsmsg.TimeFormat != "" {
oi.LastModified = cos.FormatNanoTime(0, lsmsg.TimeFormat) // 1970-01-01 epoch
}

return oi
}

Expand Down

0 comments on commit 034f22e

Please sign in to comment.