1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/image
Rob Cowsill 42dba8c3f9
Fix spurious error from "docker load"
"docker load" validates parent links by comparing image histories, and the
History struct has a time.Time member "Created". Time.UnmarshalJSON can read
RFC3339 timestamps with offset "+00:00", but t.MarshalJSON writes them with
offset "Z". Equivalent times in these two formats are not equal when compared
with the == operator.

This causes checkValidParent to incorrectly return false when the parent image
history contains times using offset "+00:00". In that case the history copied
to the child image will have been converted into "Z" form when marshaled out.

This patch adds an "Equal" method to History, which compares "Created" times
with t.Equal. This is used instead of reflect.DeepEqual in checkValidParent.

Signed-off-by: Rob Cowsill <42620235+rcowsill@users.noreply.github.com>
2021-01-21 22:04:23 +00:00
..
cache Add canonical import comment 2018-02-05 16:51:57 -05:00
spec delete unnecessary blank lines 2018-12-11 09:07:37 +08:00
tarexport Fix spurious error from "docker load" 2021-01-21 22:04:23 +00:00
v1 goimports: fix imports 2019-09-18 12:56:54 +02:00
fs.go goimports: fix imports 2019-09-18 12:56:54 +02:00
fs_test.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
image.go Fix spurious error from "docker load" 2021-01-21 22:04:23 +00:00
image_test.go Fix spurious error from "docker load" 2021-01-21 22:04:23 +00:00
rootfs.go image: do actual RootFS.DiffIDs copying in Clone() 2019-03-18 01:05:40 +03:00
store.go replace json.Unmarshal with NewFromJSON in Create 2021-01-11 23:01:44 +08:00
store_test.go replace json.Unmarshal with NewFromJSON in Create 2021-01-11 23:01:44 +08:00