By default, go's tar archiver uses USTAR header format. Unfortunately, this format doesn't support sub-second resolution for ModTime. Go solves this by *rounding* the time. Sometimes, this creates an archive containing a file with modtime from the future. When such archive is untarred by GNU tar, the following message is produced: tar: bf548dfd-0a90-40e6-bbf2-dcdd82fcbb4e.json: time stamp 2020-07-13 13:34:31 is 0.356223173 s in the future We have two options here: 1) Use gnu header format that supports sub-second resolution. Unfortunately, it seems that not all tar archivers support this format (e.g. 7-zip). 2) The other option is to truncate the date (instead of rounding). I went with option 2. Also, this commit adds a test to check that the header is not from the future. Without this fix, the test is actually failing, I verified this manually. Fixes #854 |
||
|---|---|---|
| .. | ||
| api.go | ||
| api_test.go | ||
| compose.go | ||
| json.go | ||
| upload.go | ||
| util.go | ||